Boiler
Bundle Node.js compatible modules to one browser compatible file.
$ boiler app.js > bundle.js
Examples
Install Backbone with NPM and use in browser:
npm install backbone
var Backbone = ;
Underscore will be downloaded by NPM and bundled as a dependecy to Backbone.
Include a non-global jquery instance:
// app.jsvar $ = ; ;
To use your boiled module in the browser, include it in a script tag and access
the exported function through boiler.main
.
// app.jsmoduleexports = { ; }
To use browser javascripts as Node.js modules you can require them with boiler:
Warning: example doesn't work without injecting a fake window object, but can be done in theory
// my-node-program.jsvar boiler = L = ; console;
$ node my-node-program.js