• Stars
    star
    27,233
  • Rank 669 (Top 0.02 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fast, disk space efficient package manager

简体中文 | 日本語 | 한국어 | Italiano | Português Brasileiro

Fast, disk space efficient package manager:

  • Fast. Up to 2x faster than the alternatives (see benchmark).
  • Efficient. Files inside node_modules are linked from a single content-addressable storage.
  • Great for monorepos.
  • Strict. A package can access only dependencies that are specified in its package.json.
  • Deterministic. Has a lockfile called pnpm-lock.yaml.
  • Works as a Node.js version manager. See pnpm env use.
  • Works everywhere. Supports Windows, Linux, and macOS.
  • Battle-tested. Used in production by teams of all sizes since 2016.
  • See the full feature comparison with npm and Yarn.

To quote the Rush team:

Microsoft uses pnpm in Rush repos with hundreds of projects and hundreds of PRs per day, and we’ve found it to be very fast and reliable.

npm version Join the chat at Discord OpenCollective OpenCollective Twitter Follow Stand With Ukraine

Platinum Sponsors

Gold Sponsors

Silver Sponsors

Support this project by becoming a sponsor.

Background

pnpm uses a content-addressable filesystem to store all files from all module directories on a disk. When using npm, if you have 100 projects using lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be stored in a content-addressable storage, so:

  1. If you depend on different versions of lodash, only the files that differ are added to the store. If lodash has 100 files, and a new version has a change only in one of those files, pnpm update will only add 1 new file to the storage.
  2. All the files are saved in a single place on the disk. When packages are installed, their files are linked from that single place consuming no additional disk space. Linking is performed using either hard-links or reflinks (copy-on-write).

As a result, you save gigabytes of space on your disk and you have a lot faster installations! If you'd like more details about the unique node_modules structure that pnpm creates and why it works fine with the Node.js ecosystem, read this small article: Flat node_modules is not the only way.

💖 Like this project? Let people know with a tweet

Getting Started

Benchmark

pnpm is up to 2x faster than npm and Yarn classic. See all benchmarks here.

Benchmarks on an app with lots of dependencies:

Usage Trend

Usage Trend of pnpm

image

Backers

Thank you to all our backers! Become a backer

Contributors

This project exists thanks to all the people who contribute. Contribute.

License

MIT

More Repositories

1

pacquet

experimental package manager for node.js
Rust
748
star
2

action-setup

Install pnpm package manager
TypeScript
741
star
3

only-allow

Force a specific package manager to be used on a project
JavaScript
530
star
4

benchmarks-of-javascript-package-managers

Benchmarks of JavaScript Package Managers
JavaScript
443
star
5

pnpm.io

pnpm's website
JavaScript
190
star
6

pn

This is an experimental wrapper over the pnpm CLI written in Rust
Rust
82
star
7

awesome-pnpm

Awesome pnpm resources
77
star
8

symlink-dir

Cross-platform directory symlinking
TypeScript
68
star
9

meta-updater

TypeScript
50
star
10

supi

Fast, disk space efficient installation engine. Used by pnpm
TypeScript
24
star
11

reflink

JavaScript
23
star
12

rfcs

16
star
13

get.pnpm.io

JavaScript
16
star
14

registry-mock

Mock the npm registry
JavaScript
15
star
15

merge-driver

A merge driver for pnpm-lock.yaml
TypeScript
15
star
16

sample-project

A sample project demonstrating the results of installing with pnpm
14
star
17

self-installer

Installs pnpm
JavaScript
13
star
18

docker-pnpm

Automated docker image with pnpm pre-installed
Shell
12
star
19

get-npm-tarball-url

Create the tarball URL of a npm package
TypeScript
11
star
20

hook-utils

A helper for pnpmfile.js files
TypeScript
8
star
21

spec

pnpm specifications
8
star
22

exec

Executes pnpm. If pnpm is not installed, installs it first
TypeScript
6
star
23

node-modules-check

Checks packages in node_modules
TypeScript
5
star
24

graph-sequencer

JavaScript
5
star
25

ecosystem-issues

5
star
26

link-bins

Link bins to node_modules/.bin
TypeScript
4
star
27

pnpm-default-reporter

The default reporter of pnpm
TypeScript
4
star
28

semver-diff

Gets the difference between two semver versions
TypeScript
4
star
29

parse-codeload-url

Parse a tarball URL hosted on codeload.github.com
TypeScript
4
star
30

parse-npm-tarball-url

Parse a tarball URL hosted in the npm registry
TypeScript
3
star
31

pnpm-shrinkwrap

pnpm's shrinkwrap
TypeScript
3
star
32

store-path

Resolves the pnpm store path
TypeScript
3
star
33

logger

Logger for pnpm
TypeScript
3
star
34

encode-registry

Encodes a registry URL. Memoized.
JavaScript
2
star
35

remove-all-except-outer-links

Removes everything from a folder except external symlinks
JavaScript
2
star
36

tarball-fetcher

Fetcher for packages hosted as tarballs
TypeScript
2
star
37

file-reporter

A file reporter for pnpm
TypeScript
2
star
38

components

TypeScript
2
star
39

pnpm-simple-reporter

A simple reporter for pnpm
TypeScript
2
star
40

pnpm-list

List installed packages in a symlinked `node_modules`
TypeScript
2
star
41

colorize-semver-diff

Makes a colorful semver diff
TypeScript
2
star
42

fetch-from-npm-registry

A fetch lib specifically for using with the npm registry
TypeScript
2
star
43

npm-resolver

Resolver for npm-hosted packages
TypeScript
1
star
44

credentials-by-uri

Gets credentials for URI from npm configs
JavaScript
1
star
45

normalize-registry-url

Normalizes a npm registry URL
JavaScript
1
star
46

lib

1
star
47

package-requester

Concurrent downloader of npm-compatible packages
TypeScript
1
star
48

check-package

Checks the integrity of a package
TypeScript
1
star
49

fs-locker

An fs locker for pnpm
TypeScript
1
star
50

manifesto

The pnpm manifesto
1
star
51

package-store

A storage for npm packages. Used by pnpm
TypeScript
1
star
52

version-selector-type

Returns the type of a version selector
JavaScript
1
star
53

pkgid-to-filename

Converts a package ID to a valid file name
TypeScript
1
star
54

resolver-base

Types for pnpm-compatible resolvers
TypeScript
1
star
55

pnpm-bin-runner

A bin runner for pnpm
TypeScript
1
star
56

default-fetcher

pnpm's default package fetcher
TypeScript
1
star
57

test-git-fetch

JavaScript
1
star
58

tarball-resolver

Resolver for tarball dependencies
TypeScript
1
star
59

redirects

1
star
60

modules-yaml

Reads/writes node_modules/.modules.yaml
TypeScript
1
star
61

.github

1
star
62

pnpm-install-checks

A package that contains checks that pnpm runs during the installation.
JavaScript
1
star
63

lifecycle

Package lifecycle hook runner
TypeScript
1
star
64

headless

Fast installation using only shrinkwrap.yaml
TypeScript
1
star
65

read-package-json

TypeScript
1
star
66

dependency-path

Utilities for working with symlinked node_modules
TypeScript
1
star
67

server

A pnpm installer server
TypeScript
1
star
68

testimonials

Testimonials about pnpm
1
star
69

outdated

Check for outdated packages
TypeScript
1
star
70

fetcher-base

Types for pnpm-compatible fetchers
TypeScript
1
star
71

default-resolver

pnpm's default package resolver
TypeScript
1
star
72

types

Basic types used by pnpm
TypeScript
1
star
73

assert-project

Utils for testing projects that use pnpm
TypeScript
1
star
74

git-fetcher

Fetcher for git-hosted packages
TypeScript
1
star
75

pnpmr

Deprecated. Use the `pnpm recursive` commands instead
JavaScript
1
star
76

local-resolver

Resolver for local packages
TypeScript
1
star
77

package-bins

Returns bins of a package
TypeScript
1
star
78

dependencies-hierarchy

Creates a dependencies hierarchy for a symlinked node_modules
TypeScript
1
star
79

git-resolver

Resolver for git-hosted packages
TypeScript
1
star