publish-packed
Publishes a package together with its dependencies
Last updated 4 months ago by zkochan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install publish-packed -g
SYNC missed versions from official npm registry.

publish-packed

npm version Status

Publishes a package together with its dependencies

When publishing a package, dependencies are not bundled with the package. Although you could use bundledDependencies, you have to list all the dependencies you want to bundle.

publish-packed bundles all dependencies with your package:

  1. it installs all your dependencies first

  2. it moves the node_modules folder from the root of your package to lib/node_modules

    When publishing, npm ignores the node_modules folder in the root of your package. However, it packs all node_modules in subfolders.

  3. it escapes the dependencies field in your package's package.json, so during installation no dependencies of your package will be installed, except optional dependencies.

  4. it can prune node_modules, removing markdown files, tests, configs and other resources that are not code

Limitations:

  1. you can use publish-packed only if all your source code is in the lib/ directory because all you dependencies are going to be inside lib/node_modules.
  2. you can use publish-packed only if your prod dependencies don't have lifecycle events like postinstall that should be executed during installation

Installation

npm install --global publish-packed

Usage

Install in-publish as dev dependency

npm install --save-dev in-publish

Add it to package.json:

  "scripts": {
    "prepublish": "in-publish && echo 'You need to use \"publish-packed\" to publish this package' && false || not-in-publish"
  }

To publish the package, run publish-packed.

License

MIT © Zoltan Kochan

Current Tags

  • 2.1.1                                ...           latest (4 months ago)
  • 2.1.0                                ...           next (10 months ago)

10 Versions

  • 2.1.1                                ...           4 months ago
  • 2.1.0                                ...           10 months ago
  • 2.0.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 6
Last Day 0
Last Week 1
Last Month 13
Dependencies (13)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |