Browsify
Batch convert CommonJS modules into a browser compatible package.
Installation
npm install -g browsify
CLI Examples
browsify path/file.js >> modules.js
browsify path/to/files/ >> modules.js
browsify ../../relative/path/lib --truncate-prefix ../../relative/path/ >> modules.js
browsify path/to/files/ --namespace objname >> modules.js
For more options.
browsify -h
Using In Code
npm install browsify
then require the processor module..
var processor = processor opts = {}; // ex: {namespae: "foo"} processor;
Before Running Locally
./configure
Use Case Example
browsify lib/foo.js >> modules.js
modules.js looks like:
// browser-require // for each modulerequire;
..and in the browser you would require the module as expected.
var foo = ;
..or if there was a --namespace ns
specified, you would require it as so.
var foo = ns;
Versioning
This project ascribes to semantic versioning.