Package Managers
This content is for Frontend. Switch to the latest version for up-to-date documentation.
Package managers are tools that automate the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner. In the JavaScript ecosystem, they manage project dependencies stored in node_modules.
Popular Package Managers
Section titled “Popular Package Managers”npm (Node Package Manager)
Section titled “npm (Node Package Manager)”The default package manager for Node.js. It’s the largest software registry in the world and the industry standard.
# Initialize a projectnpm init -y# Install a packagenpm install lodashpnpm (Performant npm)
Section titled “pnpm (Performant npm)”A fast, disk space efficient package manager. It uses a content-addressable storage to store all files from all packages on a disk, preventing duplicate downloads and saving gigabytes of space.
# Install a packagepnpm add lodashCreated by Facebook to solve performance and security issues with early versions of npm. It introduced the lockfile concept to ensure consistent installs across different machines.
# Install a packageyarn add lodashA fast all-in-one JavaScript runtime and toolkit. It includes a package manager that is significantly faster than npm, yarn, and pnpm by leveraging its own high-performance implementation.
# Install a packagebun add lodash