flattenify
Flatten any npm module into a single, require'able bundle.
Installation
$ npm install -g flattenify
Usage
Usage: flattenify <module> [options]
Options:
-h, --help output usage information
-V, --version output the version number
-o, --outfile <file> Write flattened bundle to this file. If unspecified, prints to stdout
--verbose Output more messages during operation
Example
To flatten the hashish
module into a single file bundle:
$ flattenify hashish --outfile ./hashish.js
Then, require it like any local module file (example from
hashish
docs):
var Hash = ; ;
How it works
Flattenify installs the requested module into a temporary directory (which is
later cleaned up) with npm. Browserify is then invoked with a special
incantation that generates the final node-compatible module, saved into
outfile
.