{"_id":"modulator","_rev":"5-0ff82d6ca5b540cda912d8870bae5416","name":"modulator","description":"Easy build tool for running node modules in a non-CommonJS environment.","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"modulator","main":"lib/Modulator.js","author":{"name":"Roland Poulter"},"version":"0.1.0","keywords":["make","build","modules","browser","require","module","exports","unobtrusive"],"homepage":"https://github.com/rolandpoulter/node_modulator","repository":{"type":"git","url":"git://github.com/rolandpoulter/node_modulator.git"},"description":"Easy build tool for running node modules in a non-CommonJS environment.","contributors":[],"dependencies":{"uglify-js":"x"},"_npmUser":{"name":"rolandpoulter","email":"rolandpoulter@gmail.com"},"_id":"modulator@0.1.0","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-beta-4","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"cfd515843f91d673f15561d9799df7804ad03266","tarball":"https://registry.npmjs.org/modulator/-/modulator-0.1.0.tgz","integrity":"sha512-rRMKgCPXlm5aTt4/liXWz7+JZ2ylwRFomKLoldG9wXtdOQ1XawJJdT6/6VwAYRhjMqFtE6qn+RDkoJlq70S2KQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsXxhrHwjVOLCPH/IL/p4io/dhKQklNa32xaLYhbjBowIgdTd8ufPugrANLdZ/+aaJI7c5U4qsIBaqjTpJyIoJqZ8="}]},"maintainers":[{"name":"rolandpoulter","email":"rolandpoulter@gmail.com"}]}},"readme":"# Modulator\n\nRun Node.js modules in a non-CommonJS environment, say a web browser. Do this by providing a shallow representation of the filesystem, a dummy CommonJS module api.\n\nCompiling everything into one source file. And optionally minimizing the output to a separate source file with uglify.\n\nBe able to include big dependencies like jQuery without taking forever. Super simple easy direct use. No binaries, make your own.\n\n### Installation.\n\n\tnpm install modulator\n\n## Documentation.\n\n### How to use the build tool.\n\n`example/build.js`\n\n\tvar Modulator = require('modulator');\n\tmodule.exports = new Modulator({\n\t\tname: 'myBuild',\n\t\tmain: './source',\n\t\tfrom: __dirname + '/',\n\t\twrite: __dirname + '/output.js',\n\t\tuglify: __dirname + '/output-min.js',\n\t\theader: '//myBuild',\n\t\tfooter: '//' + Date(),\n\t\tapiName: 'myBuild'\n\t});\n\n`example/source.js`\n\n\tvar moduleFoo = require('moduleFoo'),\n\t    scriptBar = require('./scriptBar');\n\texports.foo = moduleFoo;\n\texports.bar = scriptBar;\n\n`./node_modules/moduleFoo/index.js`\n\n\texports.name = 'moduleFoo';\n\n`example/scriptBar.js`\n\n\texports.name = 'scriptBar';\n\n`example/output.js`\n\n\t//myBuild\n\t(function(){\n\tvar myBuild = (function(){\"use strict\";\n\t\t...\n\t}).call(this);\n\tmyBuild.provide(\"/source\", function (require, module, exports) {\n\t\t...\n\t});\n\tmyBuild.provide(\"/scriptBar\", function (require, module, exports) {\n\t\t...\n\t});\n\tmyBuild.provide(\"/node_modules/moduleFoo/index\", function (require, module, exports) {\n\t\t...\n\t});\n\t(function(){\"use strict\";\n\t\t...\n\t}).call(this);\n\t}).call(this);\n\t//Fri Dec 09 2011 20:39:29 GMT-0800 (PST)\n\n### How to use from the browser.\n\nNow we're running `example/myBuild.js` in a web page.\n\n\t<script src=\"example/output.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n\nFrom another script on the page we can access our module's exports from `myBuild.js` from `this.myBuildName` or `window.myBuildName`.\n\n\tvar myBuild = this.myBuildName;\n\nAdditionally we can require modules and files which `example/myBuild.js` required.\n\n\tvar moduleFoo = myBuild.require('moduleFoo'),\n\t    scriptBar = myBuild.require('./scriptBar');\n\nIf you decide you don't want myBuild polluting your global namespace you can noConflict it like you would with jQuery.\n\n\tmyBuild = this.myBuildName.noConflict();\n\n\n## MIT License\n\nCopyright (C) 2011 by Roland Poulter\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","maintainers":[{"name":"rolandpoulter","email":"rolandpoulter@gmail.com"}],"time":{"modified":"2022-06-20T03:30:37.036Z","created":"2012-01-13T07:28:31.989Z","0.1.0":"2012-01-13T07:28:54.454Z"},"author":{"name":"Roland Poulter"},"repository":{"type":"git","url":"git://github.com/rolandpoulter/node_modulator.git"}}