HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pnpm — Fast, disk space efficient package manager for Node.js. Manage Node.js projects and their module dep

Submitted by: @import:tldr-pages··
0
Viewed 0 times
spacecommanddiskefficientclifastpackagepnpm

Problem

How to use the pnpm command: Fast, disk space efficient package manager for Node.js. Manage Node.js projects and their module dependencies. More information: <https://pnpm.io/pnpm-cli>.

Solution

pnpm — Fast, disk space efficient package manager for Node.js. Manage Node.js projects and their module dependencies. More information: <https://pnpm.io/pnpm-cli>.

Create a package.json file:
pnpm init


Download all the packages listed as dependencies in package.json:
pnpm {{[i|install]}}


Download a specific version of a package and add it to the list of dependencies in package.json:
pnpm add {{module_name}}@{{version}}


Download a package and add it to the list of dev dependencies in package.json:
pnpm add {{module_name}} {{[-D|--save-dev]}}


Download a package and install it globally:
pnpm add {{module_name}} {{[-g|--global]}}


Uninstall a package and remove it from the list of dependencies in package.json:
pnpm {{[rm|remove]}} {{module_name}}


Print a tree of locally installed modules:
pnpm {{[ls|list]}}


List top-level globally installed modules:
pnpm {{[ls|list]}} {{[-g|--global]}} --depth {{0}}

Code Snippets

Create a `package.json` file

pnpm init

Download all the packages listed as dependencies in `package.json`

pnpm {{[i|install]}}

Download a specific version of a package and add it to the list of dependencies in `package.json`

pnpm add {{module_name}}@{{version}}

Download a package and add it to the list of dev dependencies in `package.json`

pnpm add {{module_name}} {{[-D|--save-dev]}}

Download a package and install it globally

pnpm add {{module_name}} {{[-g|--global]}}

Context

tldr-pages: common/pnpm

Revisions (0)

No revisions yet.