JSPM

pnpm

0.47.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26233139
  • Score
    100M100P100Q205953F
  • License MIT

A fast implementation of npm install

Package Exports

  • pnpm
  • pnpm/lib/bin/pnpm.js
  • pnpm/lib/logger
  • pnpm/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pnpm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pnpm

npm version Status Windows build status

Performant npm installations

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

Read our contributing guide if you're looking to contribute.

Follow the pnpm Twitter account for updates.

Table of Contents

Background

pnpm maintains a flat storage of all your dependencies in ~/.pnpm-store. They are then linked wherever they're needed. This nets you the benefits of less disk space usage, while keeping your node_modules clean. See store layout for an explanation.

=> - a link (also known as a hard link)
-> - a symlink (or junction on Windows)

~/.store
   ├─ chalk/1.1.1/
   |  ├─ index.js
   |  └─ package.json
   ├─ ansi-styles/2.1.0/
   |  ├─ index.js
   |  └─ package.json
   └─ has-ansi/2.0.0/
      ├─ index.js
      └─ package.json
.
└─ node_modules/
   ├─ .resolutions/
   |   ├─ chalk/1.1.1/
   |   |  ├─ node_modules/
   |   |  |  ├─ ansi-styles/ -> ../../ansi-styles/2.1.0/
   |   |  |  └─ has-ansi/    -> ../../has-ansi/2.0.0/
   |   |  ├─ index.js        => ~/.store/chalk/1.1.1/index.js
   |   |  └─ package.json    => ~/.store/chalk/1.1.1/package.json
   |   ├─ has-ansi/2.0.0/
   |   |  ├─ index.js        => ~/.store/has-ansi/2.0.0/index.js
   |   |  └─ package.js      => ~/.store/has-ansi/2.0.0/package.json
   |   └─ ansi-styles/2.1.0/
   |      ├─ index.js        => ~/.store/ansi-styles/2.1.0/index.js
   |      └─ package.js      => ~/.store/ansi-styles/2.1.0/package.json
   └─ chalk/                 -> ./.resolutions/chalk/1.1.1/

Install

Install it via npm.

npm install -g pnpm

Do you wanna use pnpm on CI servers? See: Continuous Integration.

Usage

Use pnpm in place of npm. It overrides pnpm i, pnpm install and some other command, the rest will passthru to npm.

pnpm install lodash

For using globally installed packages, see: global install.

For using the programmatic API, see: API.

Known issues

Some packages are trying to find and use other packages in node_modules. However, when installed via pnpm, all the dependencies in node_modules are just symlinks. Node's require ignores symlinks when resolving modules and this causes a lot of issues. Luckily, starting from v6.3.0, Node.js has a CLI option to preserve symlinks when resolving modules (--preserve-symlinks).

Things to remember:

  • pnpm is best used on Node.js >= 6.3.0
  • it is recommended to run Node with the --preserve-symlinks option. E.g. node --preserve-symlinks index. Note: it is important that --preserve-symlinks is at the beginning of the command, otherwise it is ignored.
  • CLI apps installed with pnpm are configured to correctly work with symlinked dependency trees. If a global package is used to work with a pnpm package, the global package should be installed via pnpm.

Benchmark

pnpm is usually 10 times faster than npm and 30% faster than yarn. See this benchmark which compares the three package managers on different types of applications.

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

Preview release

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

License

MIT © Rico Sta. Cruz and contributors