umma.dev

PNPM? NPM? And What Happened to Yarn?

Comparing PNPM, NPM and Yarn. Looking at what each one offers and what differentiates one from the other.

PNPM

An alternative to NPM and the newest package manager, it’s built ontop of NPM.

Performance and disk efficiency: Three times faster and more efficent than NPM; both cold and hot cache, it’s also faster than Yarn.

Security: Some security vulnerabilities that have affect projects

Structure of projects: Doesn’t create a flattened dependency tree, in node_modules everything has it’s own package.json

NPM

The standard/default package manager when it comes to JavaScript/Node.js applications.

Performance and disk efficiency: Slightly slower than PNPM

Security: Does checksums and verifies integrity of code

Structure of projects: You can manually add a .npmrc file at root level

Yarn

Package manager developed by Facebook, which at one point was faster, more reliable and secure than NPM.

Performance and disk efficiency: A little faster than NPM as it installs packages parallely and uses flatten node_modules directory

Security: Checksums stored in yarn.lock and prevents you from installing malicious packages

Structure of projects: You can manually add a .yarnrc file at root level and it also will recognise a .npmrc file