Rico Sta. Cruz 0715d27f7c Add docs
2016-02-01 18:15:24 +08:00
2016-02-01 04:29:33 +08:00
2016-02-01 18:15:24 +08:00
2016-02-01 18:15:24 +08:00
2016-01-28 23:41:10 +08:00
2016-01-28 13:59:21 +08:00
2016-02-01 04:31:17 +08:00
2016-02-01 04:30:04 +08:00
2016-02-01 18:15:24 +08:00

pnpm

Performant npm

pnpm is a fast implementation of npm install. It is loosely based off [ied].

npm version Status

Install

Install it via npm.

npm install -g pnpm.js

Use pnpm in place of npm. It overrides pnpm i and pnpm install—all other commands will passthru to npm.

pnpm install lodash

Custom registries

pnpm uses whatever npm's configured to use as its registry. See: custom registries.

Preview release

pnpm will stay in <1.0.0 until it's achieved feature parity with npm install. See roadmap for details.

Design

pnpm maintains a flat storage of all your dependencies in node_modules/.store. They are then symlinked whereever they're needed. This is like npm@2's recursive module handling (without the disk space bloat), and like npm@3s flat dependency tree (except with each module being predictably atomic). To illustrate, an installation of chalk@1.1.1 may look like this:

.
└─ node_modules/
   ├─ .store/
   │  ├─ chalk@1.1.1/_/
   │  │  └─ node_modules/
   │  │     ├─ ansi-styles      -> ../../../ansi-styles@2.1.0/_
   │  │     ├─ has-ansi         -> ../../../has-ansi@2.0.0/_
   │  │     └─ supports-color   -> ../../../supports-color@2.0.0/_
   │  ├─ ansi-styles@2.1.0/_/
   │  ├─ has-ansi@2.0.0/_/
   │  └─ supports-color@2.0.0/_/
   └─ chalk                     -> .store/chalk@1.1.1/_

The intermediate _ directories are needed to hide node_modules from npm utilities like npm ls, npm prune, npm shrinkwrap and so on. The name _ is chosen because it helps make stack traces readable.

Benchmark

time npm i babel-preset-es2015 browserify chalk debug minimist mkdirp
    66.15 real        15.60 user         3.54 sys

time pnpm i babel-preset-es2015 browserify chalk debug minimist mkdirp
    11.04 real         6.85 user         2.85 sys

Prior art

Thanks

pnpm © 2016+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

Description
No description provided
Readme MIT 250 MiB
Languages
TypeScript 99.4%
JavaScript 0.6%