Overview
PNPM (Performant NPM) is a fast, disk space-efficient package manager for JavaScript. It uses a unique symlink-based approach to manage dependencies, which results in faster installs and reduced disk space usage compared to NPM.
PNPM ensures that multiple projects using the same dependency do not duplicate it on disk, thus saving space and speeding up the installation process.
Installation
There are multiple ways to install Pnpm. In this guide, we will show the three easiest methods for installing Pnpm. You can find information on other methods here.
Usage
Initializing a Project
This command creates a package.json file in your project directory, which is used to manage the project's dependencies, scripts, and other metadata.
Installing a Package
This command installs a package locally in your project, similar to NPM, but with performance and disk space optimizations.
Example
This installs the react package.
Installing a Package Globally
This command installs a package globally on your system, making it available from any directory.
Example
This installs the typescript package globally.
Updating a Package
This command updates a package to the latest version. If no package name is specified, it updates all project dependencies.
Example
This updates the react package to its latest version.
Uninstalling a Package
This command removes a package from your project and updates the package.json and package-lock.json files accordingly.
Example
This uninstalls the react package.