Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
pnpm is a fast, disk space efficient package manager for JavaScript that works with the npm and Yarn registries. It uses hard links and symlinks to save disk space and improve installation speed. It also has a strict node_modules structure that helps to avoid issues with phantom dependencies.
Installing packages
Installs the lodash package into your project. This is similar to npm install or yarn add.
pnpm install lodash
Creating a new project
Initializes a new package.json file for your project, similar to npm init or yarn init.
pnpm init
Adding a package to dependencies
Adds the react package to your project's dependencies, similar to npm install react --save or yarn add react.
pnpm add react
Adding a package to devDependencies
Adds the typescript package to your project's devDependencies, similar to npm install typescript --save-dev or yarn add typescript --dev.
pnpm add --save-dev typescript
Updating packages
Updates all the packages in your project to their latest versions based on the specified ranges in package.json, similar to npm update or yarn upgrade.
pnpm update
Running scripts
Runs the script named 'build' specified in your package.json, similar to npm run build or yarn run build.
pnpm run build
npm is the default package manager for Node.js and is the most widely used. It has a large ecosystem and is well-supported, but it can be slower and use more disk space compared to pnpm.
Yarn is a package manager that was created by Facebook to address some of npm's shortcomings. It introduced lockfiles and deterministic installations. Yarn is faster than npm but can still use more disk space compared to pnpm.
Fast, disk space efficient npm installs
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.
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 drastically 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)
~/.pnpm-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/
| | | ├─ chalk -> ../package
| | | ├─ ansi-styles/ -> ../../ansi-styles/2.1.0/package
| | | └─ has-ansi/ -> ../../has-ansi/2.0.0/package
| | └─ package
| | ├─ index.js => ~/.pnpm-store/chalk/1.1.1/index.js
| | └─ package.json => ~/.pnpm-store/chalk/1.1.1/package.json
| ├─ has-ansi/2.0.0/
| | ├─ node_modules/
| | | └─ has-ansi -> ../package
| | └─ package
| | ├─ index.js => ~/.pnpm-store/has-ansi/2.0.0/index.js
| | └─ package.js => ~/.pnpm-store/has-ansi/2.0.0/package.json
| └─ ansi-styles/2.1.0/
| ├─ node_modules/
| | └─ ansi-styles -> ../package
| └─ package
| ├─ index.js => ~/.pnpm-store/ansi-styles/2.1.0/index.js
| └─ package.js => ~/.pnpm-store/ansi-styles/2.1.0/package.json
└─ chalk/ -> ./.resolutions/chalk/1.1.1/package
Install it via npm.
npm install -g pnpm
Do you wanna use pnpm on CI servers? See: Continuous Integration.
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 the programmatic API, see: API.
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
pnpm
will stay in <1.0.0
until it's achieved feature parity with npm install
. See roadmap for details.
MIT © Rico Sta. Cruz and contributors
FAQs
Fast, disk space efficient package manager
The npm package pnpm receives a total of 14,518,714 weekly downloads. As such, pnpm popularity was classified as popular.
We found that pnpm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.