node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey ยป



NPM version Build status Test coverage Dependency Status License Downloads

A bundler for node.js projects using babel. Compiles all your local files into a single script suitable for node.js usage. This differs from webpack/browserify in that:

  • It's much simpler
  • Only uses babel
  • Does not parse node_modules - it assumes modules will still be available
  • Only supports CommonJS build outputs


  • Automatically caches builds to the local file system.


  • __dirname and __filename are not supported
  • Dynamic requires like require('./' + 'file') are not supported


nodepack(options).then(result => )


  • result.tree - the dependency tree as an array
  • result.code - the JS code bundled together


  • filename - entry file
  • hash - hash for the entire build for testing. This should primarily be based on babel configs.
  • presets - an array of babel presets to use.
  • plugins - an array of babel plugins to use.


The location of the cache directory. You could also set it via BABEL_NODEPACK_CACHE_DIR=.

nodepack.cache.rimraf().then(() => )

Clear the nodepack cache folder.

nodepack.cache.mkdirp().then(() => )

Make sure the nodepack cache folder exists.