1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/pnpm.md

38 lines
938 B
Markdown
Raw Normal View History

2021-05-03 21:26:31 +05:30
# 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>.
2021-05-03 21:26:31 +05:30
2022-08-20 16:33:47 +04:00
- Create a `package.json` file:
2021-05-03 21:26:31 +05:30
`pnpm init`
- Download all the packages listed as dependencies in `package.json`:
`pnpm install`
- Download a specific version of a package and add it to the list of dependencies in `package.json`:
2022-08-20 16:33:47 +04:00
`pnpm add {{module_name}}@{{version}}`
2021-05-03 21:26:31 +05:30
- Download a package and add it to the list of dev dependencies in `package.json`:
2021-05-03 21:26:31 +05:30
`pnpm add {{[-D|--save-dev]}} {{module_name}}`
2021-05-03 21:26:31 +05:30
- Download a package and install it globally:
2021-05-03 21:26:31 +05:30
`pnpm add {{[-g|--global]}} {{module_name}}`
2021-05-03 21:26:31 +05:30
- Uninstall a package and remove it from the list of dependencies in `package.json`:
2022-08-20 16:33:47 +04:00
`pnpm remove {{module_name}}`
2021-05-03 21:26:31 +05:30
- Print a tree of locally installed modules:
`pnpm list`
- List top-level globally installed modules:
2021-05-03 21:26:31 +05:30
`pnpm list {{[-g|--global]}} --depth {{0}}`