Khải 086b69cf60 feat: pnpmfileChecksum (#7662)
* Squashed commit of the following:

commit 912ee1af4d954d192d42cf4a2e6dae56d5bef21d
Author: Zoltan Kochan <z@kochan.io>
Date:   Thu Feb 22 02:22:22 2024 +0100

    revert: moving tarballs to lfs

commit f8943bdfd422c77e27febda9d962e9937c83dd55
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Wed Feb 21 20:35:38 2024 +0700

    refactor: move pnpmfileChecksum to requireHooks

commit 33c90e030f49aa9edf815708f846047d7dec25ca
Merge: d6e74263d 5f4b535be
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Wed Feb 21 12:06:26 2024 +0700

    chore(git): merge

commit d6e74263de8ea474b1c16cd29aac2dbdef40d102
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Wed Feb 21 12:03:13 2024 +0700

    refactor: reuse code

commit 5f4b535bed589bb5eb60ddbbb61534d62e75cfae
Author: Khải <hvksmr1996@gmail.com>
Date:   Wed Feb 21 10:21:35 2024 +0700

    refactor: revert unnecessary bumps

commit ebee6c825d08888413684856c7505d4708c960af
Merge: 82233556d c8e8eca3d
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Wed Feb 21 00:37:50 2024 +0700

    chore(git): merge from main

commit c8e8eca3debb0fb081a614346b9b1a5786b87a5d
Author: Zoltan Kochan <z@kochan.io>
Date:   Tue Feb 20 18:36:11 2024 +0100

    test(mount-modules): use local pnpm in pretest

commit e0488e5ac443b62df3aef9a161c757bc16c1bda3
Author: Zoltan Kochan <z@kochan.io>
Date:   Tue Feb 20 18:28:21 2024 +0100

    fix: unpacking tarballs that appear to be not USTAR or GNU TAR (#7677)

    close #7120

commit 82233556d4162d90a38e11d15136461008169acd
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Tue Feb 20 20:32:47 2024 +0700

    refactor: replace remove with add

commit 30293df6bdc8cc478b9d7b81cb5d09ca48855b89
Merge: 6eb0b3e81 7cb3cfb5b
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Tue Feb 20 20:31:30 2024 +0700

    chore(git): merge from main

commit 6eb0b3e81dea7ced23b4e9683d9500b4a30499a5
Merge: c1fbc11ed e4caa114a
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Tue Feb 20 16:45:23 2024 +0700

    chore(git): merge from main

commit c1fbc11eded093e923644454254b98eb0090292d
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Tue Feb 20 13:59:15 2024 +0700

    fix: pruneLockfile

commit 39a8e75a1cccd8c6f5df838eaf2c07f98c2652dd
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Tue Feb 20 02:46:41 2024 +0700

    lint: fix

commit 839de517487561ddf3d27bb77a1cfd8e373c4274
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 20:24:25 2024 +0700

    style: fix

commit 1ec2c1a40fb050221b937878decd9eeef8e9c845
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 20:01:00 2024 +0700

    feat: handle absolute path

commit 002edd4484a071638b6e2f43ab9ce76f186aa379
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 19:51:33 2024 +0700

    fix: use opts instead of rawConfig

commit d55b687735b598e7a2b235eaed5675eaf1982a40
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 19:41:51 2024 +0700

    refactor: remove an unnecessary await

commit bb595f315b8ba422128efc1ff753222c86e93fdf
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 14:08:07 2024 +0700

    feat: rawConfig.ignorePnpmfile

commit 0a17c659d303054d770e72279019b9c39e85c95d
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 14:04:13 2024 +0700

    feat: read from rawConfig

commit 276379a531163ca6271fa863c27f3c779a6849a4
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Mon Feb 19 13:53:34 2024 +0700

    feat: move pnpmfileChecksum to the option region

commit 3868abdbb25194ef5b279cfea63fab6294d46a8c
Author: Zoltan Kochan <z@kochan.io>
Date:   Sat Feb 17 00:09:19 2024 +0100

    test: fix

commit 95e6554089d30dcee25da144719b28e369d11f10
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Fri Feb 16 23:18:11 2024 +0700

    fix: test

commit 75a131aade4caa322330f6df017abd02aee0ccd9
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Fri Feb 16 23:17:45 2024 +0700

    fix: pnpmfileChecksum not appearing in the lockfile

commit 297f920b0be4671b72481709af43193522b177b3
Merge: 8ac1725a8 c7d056422
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Fri Feb 16 18:12:11 2024 +0700

    chore(git): merge from main

commit 8ac1725a83b3eccfe46b2972a77f7a780aef3564
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Fri Feb 16 18:01:58 2024 +0700

    feat: pnpmfileChecksum

commit 83788d023d478d4e559ebfbaaf2aba6e355358b5
Author: khai96_ <hvksmr1996@gmail.com>
Date:   Fri Feb 16 17:04:02 2024 +0700

    refactor: add explicit type

* fix: update lockfile when new pnpmfile removes deps

* fix: always calculate pnpmfileChecksum

* test: getPnpmfileChecksum

* test(cli): add or change pnpmfile

* refactor: try catch and await

* refactor: pnpmfile hash

* docs: add changesets

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2024-02-23 19:17:38 +01:00
2024-02-23 19:17:38 +01:00
2024-02-18 11:23:18 +01:00
2024-01-08 19:12:45 +01:00
2024-02-12 22:46:58 +01:00
2024-02-23 19:17:38 +01:00
2024-02-23 19:17:38 +01:00
2024-02-23 19:17:38 +01:00
2024-02-12 22:46:58 +01:00
2017-03-20 21:53:18 +02:00
2022-04-01 15:55:45 +03:00
2016-12-18 20:06:38 +02:00
2024-02-17 13:26:41 +01:00
2022-01-11 15:59:46 +02:00
2024-01-01 01:58:26 +01:00
2022-04-01 15:52:37 +03:00
2024-02-18 11:23:18 +01:00
2024-02-23 19:17:38 +01:00
2024-02-16 13:39:03 +01:00
2023-03-21 00:41:59 +02:00
2022-06-01 02:48:58 +03:00

简体中文 | 日本語 | 한국어 | 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 weve 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

Description
No description provided
Readme MIT 270 MiB
Languages
TypeScript 98.8%
JavaScript 0.8%
Shell 0.3%