pack-exporter

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

npm install pack-exporter
2 downloads in the last week
8 downloads in the last month

=======

packer

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

Usage

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'

Known limitations

  • 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:

Replace

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

with

var mods = [require('0'),require('1'), ... require('n')]
for (mod in mods){
  mods[mod].init()
}
npm loves you