$ sudo npm install require-bundler
$ ./rqBundle <file1> <bundled-output-file>
THE FOLLOWING STATEMENTS/TOKEN COMBINATIONS ARE NOT SUPPORTED
var exports
module["exports"]
require(variable);
require(anyThingThatIsNotAString);
module.anyThingAsideFromExports
EXPECTATIONS
module /*whitespace and comments are tolerated*/ . exports
require ( "./myModuleDir/../myModuleDir/myModule")
require("./myOtherModule.js")
myObj.exports // just an object property that shouldn't be affected
exports // will be edited
Expect the <bundled-output-file> to be obfuscated unless you edit rqBundle and remove the UglifyJS content.
Warning: the bundled file cannot be run in places that it cannot access the node_modules folder (or the views folder if you're using Express).