A tool for producing zero-dependencies node modules.
Features:
- Doesn't move around any files. It ensures backward-compatibility of packaged modules
- Doesn't package optional dependencies, you can use them for native modules
- Doesn't package devDependencies
- Can use Yarn instead of npm for reliable builds
- Can package dependencies directy from npm
- Properly handles bin paths
- Easy to use 🌹
$ npm install -g npm-packer
npm-packer <source> <target> [--yarn]
<source>
can be either existing directory or npm package prefixed withnpm:
<target>
must be non-existing directory- if
--yarn
is used, packer uses yarn instead of npm for bundling
npm-packer . dist
npm-packer npm:jquery jquery-packed
npm-packer npm:jquery jquery-packed --yarn
- Runs "npm pack" on
- Performs "npm install --production" on
- Copies installed modules to "/vendor/node_modules"
- Rewrites all require(...) calls
- Removes "dependencies" from package.json
The bundle in <target>
should be ready for publication with npm publish
MIT © Adam Stankiewicz