Packer is used to traverse the require dependencies and export the files as a package

======= packer ======

Packer will take an entry point and traverse "require" dependencies, packing the related files in an output directory

Packer supports the following CLI options:

-s : Source file. This is the entry point for traversal
-o : Output directory. This defaults to 'source/file/directory/package'

And can be run like this:

node run.js -s '/this/is/the/source/file'
  • The generated package.json file will reference the wilcard (*) versions of the modules.
  • Modules which are required dynamically not parse correctly and will not be included in the packaged output. eg:


for (var files in directory){
  var mymod = require(file);


var mods = [require('0'),require('1'), ... require('n')]
for (mod in mods){