# CLI Packages This is a cheat sheet that you can use as a handy reference for [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) and [deno](https://deno.com/) commands. > Note: `` follow this structure `` ## Package Commands | TODO | command | swpm | npm | yarn | yarn (berry) | pnpm | bun | deno | | ---- | ------------------------------------------- | --------------------------------------- | --------------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ------------------------------------ | ------------------------------------ | | [ ] | clean cache | | `npm cache clean` | `yarn cache clean` | `yarn cache clean` | N/A | `bun pm cache rm` | `deno clean` | | [x] | install from `package.json` | `swpm install` | `npm install` | `yarn [install]` | `yarn [install]` | `pnpm install` | `bun install` | `deno install` | | [x] | don't read or generate a lockfile | `swpm install --package-lock` | `npm install --no-package-lock` | `yarn install --no-lockfile` | `yarn install --no-lockfile` | N/A | `bun install --no-save` | `deno install --no-lock` | | [ ] | don't generate a lockfile | | | `yarn install --pure-lockfile` | `yarn install --pure-lockfile` | | N/A | N/A | | [x] | lockfile is not updated | `swpm install --frozen` | `npm ci` | `yarn install --frozen-lockfile` | `yarn install --immutable` | `pnpm install --frozen-lockfile` | `bun install --frozen-lockfile` | `deno install --frozen` | | [x] | add package | `swpm add [--global]` | `npm install [--global]` | `yarn [global] add ` | `yarn [global] add ` | `pnpm add [--global]` | `bun add [--global]` | `deno add [-g]` | | [x] | add package as `dependencies` | `swpm add ` | `npm install ` | `yarn add ` | `yarn add ` | `pnpm add ` | `bun add ` | `deno add ` | | [x] | add package as `devDependencies` | `swpm add --save-dev` | `npm install --save-dev` | `yarn add --dev` | `yarn add --dev` | `pnpm add --save-dev` | `bun add --dev` | `deno add --dev ` | | [x] | add package as `optionalDependencies` | `swpm add --save-optional` | `npm install --save-optional` | `yarn add --optional` | `yarn add --optional` | `pnpm add --save-optional` | `bun add --optional` | `deno add --optional ` | | [x] | add package as `peerDependencies` | `swpm add --save-peer` | `npm install --save-peer` | `yarn add --peer` | `yarn add --peer` | `pnpm add --save-peer` | N/A | `deno add --peer ` | | [x] | add exact version | `swpm add --save-exact` | `npm install --save-exact` | `yarn add --exact` | `yarn add --exact` | `pnpm add --save-exact` | `bun add --exact` | N/A | | [x] | remove package | `swpm remove [] [--global]` | `npm uninstall [--global]` | `yarn [global] remove ` | `yarn [global] remove ` | `pnpm uninstall [--global]` | `bun remove [] [--global]` | `deno remove [-g]` | | [x] | remove package as `dependencies` | `swpm remove ` | `npm uninstall ` | `yarn remove ` | `yarn remove ` | `pnpm uninstall ` | `bun remove ` | `deno remove ` | | [x] | remove package as `devDependencies` | `swpm remove --save-dev` | `npm uninstall --save-dev` | `yarn remove --dev` | `yarn remove --dev` | `pnpm uninstall --save-dev` | `bun remove --dev` | `deno remove ` | | [x] | remove package as `optionalDependencies` | `swpm remove --save-optional` | `npm uninstall --save-optional` | `yarn remove --optional` | `yarn remove --optional` | `pnpm uninstall --save-optional` | `bun remove --optional` | `deno remove ` | | [x] | remove package as `peerDependencies` | `swpm remove --save-peer` | `npm uninstall --save-peer` | `yarn remove --peer` | `yarn remove --peer` | `pnpm uninstall --save-peer` | N/A | `deno remove ` | | [x] | update package (no `package.json`) | `swpm update [] [--global]` | `npm update [] [--global]` | `yarn [global] upgrade []` | `yarn [global] semver up []` | `pnpm update [] [--global]` | N/A | `deno outdated --update` | | [x] | upgrade package on `package.json` | `swpm upgrade [--global]` | `npm add @latest [--global]` | `yarn [global] upgrade --latest` | `yarn [global] up ` | `pnpm update --latest [--global]` | N/A | `deno add ` | | [x] | upgrade interactive | `swpm interactive` | N/A | `yarn upgrade-interactive` | `yarn upgrade-interactive` | `pnpm upgrade --interactive` | N/A | N/A | | [ ] | list all package at the top level | | `npm list --depth 0 [--global]` | `yarn [global] list --depth 0` | `yarn [global] list --depth 0` | `pnpm list --depth 0 [--global]` | `bun pm ls` | `deno info` | | [ ] | audit vulnerable dependencies | | `npm audit [fix]` | `yarn audit` | `yarn audit` | `pnpm audit [--fix]` | | TBA | ## Shared Commands Use the same command structure between package managers. | TODO | command | swpm | npm | yarn | yarn (berry) | pnpm | bun | deno | | ---- | -------------------------------------- | -------------------------------------------- | ---------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -------------------------------- | -------------------------------- | | [x] | init or create | `swpm init` | `npm init` | `yarn init` | `yarn init` | `pnpm init` | `bun init` | `deno init` | | [x] | login/logout | `swpm ` | `npm ` | `yarn ` | `yarn ` | `pnpm ` | TBA | TBA | | [x] | run scripts | `swpm run