npm-packer

1.1.1 • Public • Published

npm-packer

Produces zero-dependencies node modules

Installation

$ npm install -g npm-packer

Usage

npm-packer <source> <target> [--yarn]
  • <source> can be either existing directory or npm package prefixed with npm:
  • <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

How it works?

  1. Runs "npm pack" on module and copies result to
  2. Performs "npm install --production" on
  3. Copies installed modules to "/vendor/node_modules"
  4. Rewrites all require(...) calls
  5. Removes "dependencies" from package.json

The bundle in <target> should be ready for publication with npm publish

License

MIT © Adam Stankiewicz

Dependents (0)

Package Sidebar

Install

npm i npm-packer

Weekly Downloads

0

Version

1.1.1

License

MIT

Last publish

Collaborators

  • sheerun