modulr is a CommonJS module implementation
which is does static analysis to recursively resolve its dependencies.
concatenated into a single
js file. This improves load times by
minimizing HTTP requests.
Further load time performance improvements are made possible by the built-in
evaluated only when required.
module free variables.
$ [sudo] gem install modulr
modulr is available as a Ruby library or as a command-line utility (
$ modulrize filename.js > output.js
For a comprehensive list of options:
$ modulrize --help"
To run the specs, first clone the Git repository then grab the CommonJS specs, included as a Git submodule, by running:
$ git clone git://github.com/codespeaks/modulr.git $ cd modulr $ git submodule init $ git submodule update
Mozilla's SpiderMonkey is required
js command line executable must be available on the load path (try
You can run all the specs by issuing:
$ rake spec
Alternatively, a list of comma-separated specs can be specified through the
environment variable (see
vendor/commonjs/tests/modules/1.0) for a comprehensive
list of available specs).
$ rake spec SPECS=absolute,transitive