{"_id":"infuse","_rev":"72-35330631f0eda4b02b9d32561498f880","name":"infuse","description":"Mainline your node JavaScript for universal consumption.","dist-tags":{"latest":"0.0.23"},"versions":{"0.0.15":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.15","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"proteus":">=0.0.x","nomnom":">=1.5.x","uglify-js":">=1.2.x","wordwrap":">=0.0.2"},"devDependencies":{"mocha":">=0.3.x","should":">=0.5.x","sake":">=0.0.x","underscore":">=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"_npmUser":{"name":"jhamlet","email":"jerry@hamletink.com"},"_id":"infuse@0.0.15","contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"26e180fc2a00ed1a247909566e22def5f3093cfa","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.15.tgz","integrity":"sha512-BmDNu+S3Sb6bAfdFlX//AjK8yJXndgaU+D2gy8l2QKrX+KBJkozBjhNSWhm0oEaiCDDUArhSl9ghT6m1/2APNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1XWAMxFWV69g4oUGTTvMYp3K8qaWnrED1Y77/TPvZKAiEAoGAbn5tRIiIPvWuqrDsaIJKcfJT6eJs8JhDQSeDNdms="}]},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.16":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.16","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":">=1.2.x","nomnom":">=1.5.x","resolve":">=0.2.x","proteus":">=0.0.x","wordwrap":">=0.0.2"},"devDependencies":{"mocha":">=0.3.x","should":">=0.5.x","sake":">=0.0.x","underscore":">=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"git://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"_npmUser":{"name":"jhamlet","email":"jerry@hamletink.com"},"_id":"infuse@0.0.16","contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"bbf6d843aa64aa9feaaa9e0d8c0fad738f7977f1","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.16.tgz","integrity":"sha512-8ZqjnJSyflaIUo84x1787/pZK7eIEzX0Sa16ndZamLs0aTeVKRI2uT92TStBu5boxP6P7CyveB0JeJw4kTbK9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbjGBJGvO8AwR6Q881T9jRCi0y3zYoo40pb9dFRTqAfAiEAij8Ec2F6/p/dnC6w1v/Ssikc9PgyOXrZqPm8rS4/6p8="}]},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.17":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.17","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":">=1.3.x","nomnom":">=1.5.x","resolve":">=0.2.x","proteus":">=0.0.x","wordwrap":">=0.0.2"},"devDependencies":{"mocha":">=0.3.x","should":">=0.5.x","sake":">=0.1.x","underscore":">=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"_id":"infuse@0.0.17","dist":{"shasum":"3bdd3fa7e7c2ab3a1b482b658274183eec83c947","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.17.tgz","integrity":"sha512-xD89Iq+BNrArGDup8fklNLVxfBGcdX4kiPTRSNsq2D+CjB/L1s4IWoYJq/tWF2UOLX8kySJo5qqGqbNwpJRoGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB8y1RnEEz1DGHJekLVB2Uk0P7wrGNjFodpzjv4oBe/BAiEAkQ/4RUJRapACNnaHwqhlXcdiAAaAUpHlMedwBTDjIF4="}]},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.18":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.18","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":">=1.3.x","nomnom":">=1.5.x","resolve":">=0.2.x","proteus":">=0.0.x","wordwrap":">=0.0.2"},"devDependencies":{"mocha":">=0.3.x","should":">=0.5.x","sake":">=0.1.x","underscore":">=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"_id":"infuse@0.0.18","dist":{"shasum":"f9a2d33f4aca6573d1b85fd487655cdda15bbbbb","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.18.tgz","integrity":"sha512-69jgnYUP0kjF1MtMSPOtVJB8yab5HdQvFQp31+BbHUsD9DFm1y6yVPo2LHkf/gFLNFgo0voGfCQdLEsdLIK+4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwvzidi9zU3yR8uxxbpQt8y7ylW/VL0pbcphhfyYcM5AIgLVmOkryekN6P81+fR3apeCeEwgG90be7r5MtW5aUhjw="}]},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.19":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.19","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":"=1.3.x","nomnom":"=1.5.x","resolve":"=0.2.x","proteus":"=0.0.x","wordwrap":"=0.0.2"},"devDependencies":{"mocha":"=0.3.x","should":"=0.5.x","sake":"=0.1.x","underscore":"=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"_id":"infuse@0.0.19","dist":{"shasum":"792672d80c3f860b2717f574ada8a102cdbe5a7e","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.19.tgz","integrity":"sha512-mHzmLpgdwLNwyOGnBH0A9HGV31JWn4chrjhsIeHfxGFJrggyHzaa4DbEhzXAM3JfNK8zwZBxFcAvWeD/Z5ka9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGPC+IxUpV0m8Cj2CLfQ34g2hEIyY/ZBogNcRFaImpnIAiAkvv5WWGR7YVU7StCC+f17ct5ahpw2lpMDI5U+JCZ+wQ=="}]},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.20":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.20","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":"=1.3.x","nomnom":"=1.5.x","resolve":"=0.2.x","proteus":"=0.0.x","wordwrap":"=0.0.2"},"devDependencies":{"mocha":"=0.3.x","should":"=0.5.x","sake":"=0.1.x","underscore":"=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"_id":"infuse@0.0.20","dist":{"shasum":"5c75b12ab8614114190b2331ebda23e8e07696c2","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.20.tgz","integrity":"sha512-/OBHBMYn1GUIHL5k0XLubeaIxfKTvoRKqqg9gWgRs00UVp+cI0yK869PU60OcEOHLy+fP2vmHe4zFkP2Dzo8DQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/Tq31VZ8AwtCGKjy+BLrrK73U4lw+7faDx1W0U8lvLAiBj45TRZEJSBEzUtzoEvMDBmF9ol/+BRNmWXJYqN9nM6A=="}]},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.21":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.21","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":"=1.3.x","nomnom":"=1.5.x","resolve":"=0.2.x","proteus":"=0.0.x","wordwrap":"=0.0.2"},"devDependencies":{"mocha":"=0.3.x","should":"=0.5.x","sake":"=0.1.x","underscore":"=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"_id":"infuse@0.0.21","dist":{"shasum":"bdbdebf54968cda7347d17a24c5e490b72c78ffe","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.21.tgz","integrity":"sha512-aRkzPlegtEqbDTRn89lmRixTu7amPieHe3LqPCbZtoCM4+tUK/gX8kF0It6O9zzE5qqF3zYqCnQjAmSFTslqEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBXQyy1wf3j2HZ2wOlBhB26lgkIBPLPgSqj0w52LDgnAiEAtKIVU+cZz8u7ESkuLqSpFie+cFPAjwx3w+M5V9WeR4Q="}]},"_from":".","_npmVersion":"1.2.15","_npmUser":{"name":"jhamlet","email":"jerry@hamletink.com"},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]},"0.0.23":{"name":"infuse","description":"Mainline your node JavaScript for universal consumption.","version":"0.0.23","keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"main":"./lib/infuse.js","bin":{"infuse":"./bin/infuse"},"directories":{"lib":"lib"},"dependencies":{"uglify-js":"=1.3.x","nomnom":"=1.5.x","resolve":"=0.2.x","proteus":"=0.0.x","wordwrap":"=0.0.2"},"devDependencies":{"mocha":"=0.3.x","should":"=0.5.x","sake":"=0.1.x","underscore":"=1.3.x"},"scripts":{"test":"mocha test/test-*"},"licenses":[{"type":"MIT","url":"http://github.com/jhamlet/node-infuse/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"preferGlobal":true,"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"homepage":"https://github.com/jhamlet/node-infuse","_id":"infuse@0.0.23","dist":{"shasum":"d95a8e06af3e302fe180c1982b5cf96404b856d6","tarball":"https://registry.npmjs.org/infuse/-/infuse-0.0.23.tgz","integrity":"sha512-zWpuimZoIHbdfzrO0hJY2bnSDBX1JJEP0j8tEcEMu1e1Nfxifw9od8yRdy1LfthhYavFE+fvxfhQvvRQ3Gpy4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHjrKmK/CA0XIbD56OSTtvoeZ/gfbXVwpZZtZmqI+qkAiA08/6RLPhEIPNDP3AiOnTO+bNlYbj7QV8zOQeDQ0teRw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jhamlet","email":"jerry@hamletink.com"},"maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}]}},"readme":"Infuse\n======\n\n> Mainline your node JavaScript for universal consumption.\n\n\nSummary\n-------\n\n**Infuse** bundles up your _node_ JavaScript files by following the `require(\"moduleName\")` statements in your source file(s), and then bundles it all up, and _uglifies_ (minimizes) it into one JavaScript file.\n\nIn addition, **infuse** can replace symbols found in the source file with JavaScript values _defined_ either with command line arguments, or through the use of another _node_ module.\n\nCoupled with [`uglify-js`'](https://github.com/mishoo/UglifyJS) ability to remove dead code, **infuse** acts as a pre-processor of sorts on your _uglified_ file when using the `--define` and `--define-module` options.\n\n\nInstallation\n------------\n\n~~~\n% npm install -g infuse\n~~~\n\n\nCommand Line Usage\n------------------\n\n~~~\n% infuse -h\n\nUsage: infuse INPUT_PATH OUTPUT_PATH [options]\n\nINPUT_PATH     File or directory to read.\nOUTPUT_PATH     File or directory to write to. If not specified, write to STDOUT.\n\nOptions:\n   -N, --no-minify               Do not minify the output. Essentially, set `beautify` for\n                                 the UglifyJS output.\n   -D, --define SYMBOL[=VALUE]   Replace all instances of the specified SYMBOL with VALUE.\n                                 If VALUE is not given, SYMBOL will be set to true.\n                                 Otherwise, VALUE will be a JSON parsed value, or plain\n                                 string. Can be specified multiple times.\n   -d, --define-module NAME      Will load the NAMEd module (as per require()) and 'define'\n                                 all exported properties. Can be specified multiple times.\n   -E, --embed                   Embed the infused modules as strings in the final output,\n                                 and lazy-evaluate them when required.\n   -R, --reserved WORD           A comma-delimited list of reserved words that should NOT be\n                                 mangled. Can be specified multiple times.\n   -L, --node-lib PATH           PATH to your local directory of node builtin modules. These\n                                 are used to resolve requires for 'core' modules (not\n                                 suggested). Can be specified multiple times, and each\n                                 directory will be tried.\n   -i, --infuse PATH             Pre-infuse with PATH. These files will be infused into the\n                                 final output and will be automatically 'de-fused' before\n                                 the INPUT_PATH executes. Can be specified multiple times.\n   -I, --dump-infusions          Print all the paths 'required' by INPUT_PATH (and all other\n                                 required files) to STDOUT and exit.\n   -A, --dump-ast                Dump out the generated Abstract Syntax Tree and exit.\n   -V, --version                 Print the version information and exit.\n   -h, --help                    Print this and exit.\n\nNOTES:\nIf OUTPUT_PATH is a directory then each file from INPUT_PATH will be infused and placed in\nOUTPUT_PATH. If not a directory OUTPUT_PATH is assumed to be a file, and all files from INPUT_PATH\nwill be infused and combined into OUTPUT_PATH (as '-i, --infuse').\n\n~~~\n\n\n### Dependencies ###\n\nThese are installed when **infuse** is installed.\n\n~~~\nuglify-js: >=1.3.x\nnomnom:    >=1.5.x\nresolve:   >=0.2.x\nproteus:   >=0.0.x\nwordwrap:  >=0.0.2\n~~~\n\n\n### Development Dependencies ###\n\nInstalled when you run `npm link` in the package directory.\n\n~~~\nmocha:      >=0.3.x\nshould:     >=0.5.x\nsake:       >=0.1.x\nunderscore: >=1.3.x\n~~~\n\n\nDefines\n-------\n\n**Infuse** now processes all `defines` itself, and the values returned from `defines` are translated into the appropriate AST structure. No need for your `define/define-module` to return an AST formatted array.\n\nBy having **infuse** handle the `defines` in the pre-mangled/squeezed AST, if you supply the `--no-minify` flag to **infuse** you can see the _beautified_ `uglify-js` generated output without any dead-code being removed (this is helpful when reviewing what your defines are returning/generating).\n\n\n### Example ###\n\n~~~js\n// contents my-defines.js\n\nvar env = process.env.ENVIRONMENT || \"dev\",\n    tokens = {\n        appName: \"My Great WebApp\",\n        authorName: \"Me\"\n    },\n    isDebug = env === \"dev\"\n;\n\nmodule.exports = {\n    ENVIRONMENT: env,\n    DEBUG: isDebug,\n    TOKEN: function (key) {\n        return tokens[key];\n    },\n    MY_METHOD: function () {\n        return isDebug ?\n            function () {\n                return \"is debug\";\n            } :\n            function () {\n                return \"is not debug\";\n            }\n    },\n    CONFIG: {\n        foo: \"foo\",\n        baz: [1, 2, 3],\n        doSomething: function () {\n            return \"something\";\n        },\n        isDebug: isDebug\n    }\n};\n\n// contents of my-script.js\n\nvar appConfig   = CONFIG;\n\nif (ENVIRONMENT === \"dev\") {\n    console.log(\"A note to the developer...\");\n}\n\nfunction MyClass () {}\n\nMyClass.prototype = {\n    appName: TOKEN(\"appName\"),\n    authorName: TOKEN(\"authorName\"),\n    \n    specialMethod: MY_METHOD(),\n};\n~~~\n\nRunning `infuse my-script.js script.js -d ./my-defines.js -N` (assuming `ENVIRONMENT` is set to \"dev\") the following would be produced:\n\n~~~js\n// contents of script.js\n\nvar appConfig = {\n    foo: \"foo\",\n    baz: [ 1, 2, 3 ],\n    doSomething: function() {\n        return \"something\";\n    },\n    isDebug: true\n};\n\nif (\"dev\" === \"dev\") {\n    console.log(\"A note to the developer...\");\n}\n\nfunction MyClass() {}\n\nMyClass.prototype = {\n    appName: \"My Great WebApp\",\n    authorName: \"Me\",\n    specialMethod: function() {\n        return \"is debug\";\n    }\n};\n~~~\n\nAnd the minified result (`infuse my-script.js script.js -d ./my-defines.js`) would be:\n\n~~~js\n// contents of script.js\nfunction b(){}var a={foo:\"foo\",baz:[1,2,3],doSomething:function(){return\"something\"},isDebug:true};console.log(\"A note to the developer...\"),b.prototype={appName:\"My Great WebApp\",authorName:\"Me\",specialMethod:function(){return\"is debug\"}}\n~~~\n\nNote how the `if` block was removed around the `console.log` statement, since this is \"dev\" mode. If `ENVIRONMENT` was set to some other value, `console.log` would be removed too.\n\nThere are more examples in the \"examples\" directory. Install the development dependencies, and then run:\n\n~~~\nsake examples ENVIRONMENT=[dev|prod] BUILD_TYPE=[debug|release]\n~~~\n\n\nEmbedding\n---------\n\nThe **infuse** `-E, --embed` option will _infuse_ required modules as `strings` and lazy-evaluate them when used in the final script. In the case of a browser, this means appending a script element to the `head` of the document temporarily. In other cases, **infuse** goes to the _dark side_ and uses `eval`.\n\nThe **advantage** of embedding is that the required JavaScript modules are not evaluated until the strings are put into a script node, or `eval`'d, when needed. This facilitates faster loading of the _infused_ JavaScript file, since it is, mostly, one large string.\n\n\nA Poor Man's Minifier\n---------------------\n\nYou can get started quickly with **infuse** by using the `-i, --infuse PATH` option:\n\n~~~\ninfuse -i path/one.js -i path/two.js -i path/three.js > compiled.js\n~~~\n\nThis basically **infuses** up the individual files and automatically _de-fuses_ them when the compiled script runs.\n\n\nCaveats\n-------\n\n### Run-time variables ###\n\nCurrently, **infuse** does not compute local variables, and can not determine require statements with variables defined at run-time.\n\nFor example, this **will not** work, and **infuse** will throw an error:\n\n~~~\n// script.js\n\nvar pkgModule = require(\"./\" + process.env.ENVIRONMENT + \"-pkg.js\");\n~~~\n\nThis will however:\n\n~~~\n// script.js infused with `--define PKG=prod-pkg.js`\n\nvar pkgModule = require(PKG);\n~~~\n\n\n### Global scope leakage ###\n\nSince **infuse** does not do any computing of local variables, it can not determine if variables leak outside of a required module's scope. In _node_ this is not so much a problem, since each module is run in it's own context and only the items explicitly exported through `module.exports` are exposed. **Infuse** uses an anonymous function to simulate what _node_ does, however if the **infused** module doesn't locally scope a variable with the `var` keyword, that variable will be set on the _global object_ (usually the window).\n\n\nIn the future, plans are to resolve the _caveats_ with more introspection of the AST parsed by _UglifyJS_. Stay tuned.\n\n\nReport an Issue\n---------------\n\n* [Bugs](http://github.com/jhamlet/node-infuse/issues)\n* Contact the author: <jhamlet@hamletink.com>\n\n\nLicense\n-------\n\n> Copyright (c) 2012 Jerry Hamlet <jerry@hamletink.com>\n> \n> Permission is hereby granted, free of charge, to any person\n> obtaining a copy of this software and associated documentation\n> files (the \"Software\"), to deal in the Software without\n> restriction, including without limitation the rights to use,\n> copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the\n> Software is furnished to do so, subject to the following\n> conditions:\n> \n> The above copyright notice and this permission notice shall be\n> included in all copies or substantial portions of the Software.\n> \n> The Software shall be used for Good, not Evil.\n> \n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n> OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"jhamlet","email":"jerry@hamletink.com"}],"time":{"modified":"2022-06-19T01:14:30.840Z","created":"2012-04-09T05:09:02.191Z","0.0.1":"2012-04-09T05:09:03.670Z","0.0.2":"2012-04-14T06:02:39.935Z","0.0.4":"2012-04-18T08:43:52.507Z","0.0.6":"2012-04-19T03:53:00.835Z","0.0.7":"2012-04-19T03:53:34.124Z","0.0.8":"2012-04-19T04:39:42.329Z","0.0.9":"2012-04-21T02:33:52.603Z","0.0.11":"2012-04-22T18:11:22.996Z","0.0.12":"2012-04-22T21:51:24.014Z","0.0.13":"2012-04-27T02:11:02.691Z","0.0.14":"2012-04-28T16:16:46.184Z","0.0.15":"2012-04-28T21:27:43.505Z","0.0.16":"2012-04-30T01:35:54.267Z","0.0.17":"2012-07-22T22:29:57.832Z","0.0.18":"2012-07-23T00:44:04.946Z","0.0.19":"2012-12-03T22:28:27.422Z","0.0.20":"2013-01-09T06:24:21.834Z","0.0.21":"2013-08-20T22:40:27.096Z","0.0.22":"2014-06-03T19:00:52.815Z","0.0.23":"2014-06-03T20:45:20.698Z"},"repository":{"type":"git","url":"http://github.com/jhamlet/node-infuse.git"},"users":{"fgribreau":true},"keywords":["javascript","js","minimizer","min","obfuscate","parser","generator","pre-processor","processor","ast","inject","code","fuse","infuse","package","packager","combine","combiner"],"contributors":[{"name":"Jerry Hamlet","email":"jerry@hamletink.com","url":"http://hamletink.com/"}],"bugs":{"url":"http://github.com/jhamlet/node-infuse/issues"},"readmeFilename":"README.md","homepage":"https://github.com/jhamlet/node-infuse"}