Brings exact CommonJS (require, exports) functionality to the Browser.
It has two parts:
-
A simple compiler that wraps your files in a closure that injects bound of require and exports, so you can use the exact same code client side.
-
A simple require script
bin/brequire source dest
This will recursively compile all .js files in source to a target directory (dest)
The scripts can be loaded by any means and 'required' into the main scope as necessary.
run:
bin/brequire test/src test/lib open test/test.html
to install compiler:
sudo cp bin/brequire /usr/local/bin