Node.js Reference
Kip Landergren
(Updated: )
My cheat sheet for Node.js covering basic commands and helpful resources.
Contents
- Commands
- Package Managers
-
npm
- npm access
- npm adduser
- npm audit
- npm bugs
- npm cache
- npm ci
- npm completion
- npm config
- npm dedupe
- npm deprecate
- npm diff
- npm dist-tag
- npm docs
- npm doctor
- npm edit
- npm exec
- npm explain
- npm explore
- npm find-dupes
- npm fund
- npm get
- npm help
- npm help-search
- npm hook
- npm init
- npm install
- npm install-ci-test
- npm install-test
- npm link
- npm ll
- npm login
- npm logout
- npm ls
- npm org
- npm outdated
- npm owner
- npm pack
- npm ping
- npm pkg
- npm prefix
- npm profile
- npm prune
- npm publish
- npm query
- npm rebuild
- npm repo
- npm restart
- npm root
- npm run-script
- npm sbom
- npm search
- npm set
- npm shrinkwrap
- npm star
- npm stars
- npm start
- npm stop
- npm team
- npm test
- npm token
- npm uninstall
- npm unpublish
- npm unstar
- npm update
- npm version
- npm view
- npm whoami
- Resources
- FAQ
Commands
Execute (run) a JavaScript file:
node path/to/file.js
Package Managers
npm
yarn
pnpm
npm
npm access | Set access level on published packages |
npm adduser | Add a registry user account |
npm audit | Run a security audit |
npm bugs | Report bugs for a package in a web browser |
npm cache | Manipulates packages cache |
npm ci | Clean install a project |
npm completion | Tab Completion for npm |
npm config | Manage the npm configuration files |
npm dedupe | Reduce duplication in the package tree |
npm deprecate | Deprecate a version of a package |
npm diff | The registry diff command |
npm dist-tag | Modify package distribution tags |
npm docs | Open documentation for a package in a web browser |
npm doctor | Check the health of your npm environment |
npm edit | Edit an installed package |
npm exec | Run a command from a local or remote npm package |
npm explain | Explain installed packages |
npm explore | Browse an installed package |
npm find-dupes | Find duplication in the package tree |
npm fund | Retrieve funding information |
npm get | Get a value from the npm configuration |
npm help | Get help on npm |
npm help-search | Search npm help documentation |
npm hook | Manage registry hooks |
npm init | Create a package.json file |
npm install | Install a package |
npm install-ci-test | Install a project with a clean slate and run tests |
npm install-test | Install package(s) and run tests |
npm link | Symlink a package folder |
npm ll | List installed packages |
npm login | Login to a registry user account |
npm logout | Log out of the registry |
npm ls | List installed packages |
npm org | Manage orgs |
npm outdated | Check for outdated packages |
npm owner | Manage package owners |
npm pack | Create a tarball from a package |
npm ping | Ping npm registry |
npm pkg | Manages your package.json |
npm prefix | Display prefix |
npm profile | Change settings on your registry profile |
npm prune | Remove extraneous packages |
npm publish | Publish a package |
npm query | Retrieve a filtered list of packages |
npm rebuild | Rebuild a package |
npm repo | Open package repository page in the browser |
npm restart | Restart a package |
npm root | Display npm root |
npm run-script | Run arbitrary package scripts |
npm sbom | Generate a Software Bill of Materials (SBOM) |
npm search | Search for packages |
npm set | Set a value in the npm configuration |
npm shrinkwrap | Lock down dependency versions for publication |
npm star | Mark your favorite packages |
npm stars | View packages marked as favorites |
npm start | Start a package |
npm stop | Stop a package |
npm team | Manage organization teams and team memberships |
npm test | Test a package |
npm token | Manage your authentication tokens |
npm uninstall | Remove a package |
npm unpublish | Remove a package from the registry |
npm unstar | Remove an item from your favorite packages |
npm update | Update packages |
npm version | Bump a package version |
npm view | View registry info |
npm whoami | Display npm username |
npm access
Set access level on published packages.
Usage:
npm access list packages [<user>|<scope>|<scope:team>] [<package>]
npm access list collaborators [<package> [<user>]]
npm access get status [<package>]
npm access set status=public|private [<package>]
npm access set mfa=none|publish|automation [<package>]
npm access grant <read-only|read-write> <scope:team> [<package>]
npm access revoke <scope:team> [<package>]
Options:
[--json]
[--otp <otp>]
[--registry <registry>]
Help:
npm help access
npm adduser
Add a registry user account.
Usage:
npm adduser
Options:
[--auth-type <legacy|web>]
[--registry <registry>]
[--scope <@scope>]
Alias: add-user
Help:
npm help adduser
npm audit
Run a security audit.
Usage:
npm audit [fix|signatures]
Options:
[--audit-level <info|low|moderate|high|critical|none>]
[--dry-run]
[--foreground-scripts]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--json]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--package-lock-only]
[-f|--force]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help audit
npm bugs
Report bugs for a package in a web browser.
Usage:
npm bugs [<pkgname> [<pkgname> ...]]
Options:
[--include-workspace-root]
[--no-browser|--browser <browser>]
[--registry <registry>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: issues
Help:
npm help bugs
npm cache
Manipulates packages cache.
Usage:
npm cache add <package-spec>
npm cache clean [<key>]
npm cache ls [<name>@<version>]
npm cache verify
Options:
[--cache <cache>]
Help:
npm help cache
npm ci
Clean install a project.
Usage:
npm ci
Options:
[--dry-run]
[--foreground-scripts]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help ci
npm completion
Tab Completion for npm.
Usage:
npm completion
Help:
npm help completion
npm config
Manage the npm configuration files.
Usage:
npm config set <key>=<value> [<key>=<value> ...]
npm config get [<key> [<key> ...]]
npm config delete <key> [<key> ...]
npm config list [--json]
npm config edit
npm config fix
Options:
[--editor <editor>]
[--json]
[-L|--location <global|user|project>]
[-g|--global]
[-l|--long]
Alias: c
Help:
npm help config
npm dedupe
Reduce duplication in the package tree.
Usage:
npm dedupe
Options:
[--dry-run]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: ddp
Help:
npm help dedupe
npm deprecate
Deprecate a version of a package.
Usage:
npm deprecate <package-spec> <message>
Options:
[--otp <otp>]
[--registry <registry>]
Help:
npm help deprecate
npm diff
The registry diff command.
Usage:
npm diff [...<paths>]
Options:
[--diff <package-spec> [--diff <package-spec> ...]]
[--diff-dst-prefix <path>]
[--diff-ignore-all-space]
[--diff-name-only]
[--diff-no-prefix]
[--diff-src-prefix <path>]
[--diff-text]
[--diff-unified <number>]
[--include-workspace-root]
[--tag <tag>]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help diff
npm dist-tag
Modify package distribution tags.
Usage:
npm dist-tag add <package-spec (with version)> [<tag>]
npm dist-tag rm <package-spec> <tag>
npm dist-tag ls [<package-spec>]
Options:
[--include-workspace-root]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: dist-tags
Help:
npm help dist-tag
npm docs
Open documentation for a package in a web browser.
Usage:
npm docs [<pkgname> [<pkgname> ...]]
Options:
[--include-workspace-root]
[--no-browser|--browser <browser>]
[--registry <registry>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: home
Help:
npm help docs
npm doctor
Check the health of your npm environment.
Usage:
npm doctor [connection] [registry] [versions] [environment] [permissions] [cache]
Options:
[--registry <registry>]
Help:
npm help doctor
npm edit
Edit an installed package.
Usage:
npm edit <pkg>[/<subpkg>...]
Options:
[--editor <editor>]
Help:
npm help edit
npm exec
Run a command from a local or remote npm package.
Usage:
npm exec -- <pkg>[@<version>] [args...]
npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
npm exec -c '<cmd> [args...]'
npm exec --package=foo -c '<cmd> [args...]'
Options:
[--include-workspace-root]
[--package <package-spec> [--package <package-spec> ...]]
[-c|--call <call>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: x
Help:
npm help exec
npm explain
Explain installed packages.
Usage:
npm explain <package-spec>
Options:
[--json]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: why
Help:
npm help explain
npm explore
Browse an installed package.
Usage:
npm explore <pkg> [ -- <command>]
Options:
[--shell <shell>]
Help:
npm help explore
npm find-dupes
Find duplication in the package tree.
Usage:
npm find-dupes
Options:
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help find-dupes
npm fund
Retrieve funding information.
Usage:
npm fund [<package-spec>]
Options:
[--json]
[--no-browser|--browser <browser>]
[--no-unicode]
[--which <fundingSourceNumber>]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help fund
npm get
Get a value from the npm configuration.
Usage:
npm get [<key> ...] (See `npm config`)
Options:
[-l|--long]
Help:
npm help get
npm help
Get help on npm.
Usage:
npm help <term> [<terms..>]
Options:
[--viewer <viewer>]
Alias: hlep
Help:
npm help help
npm help-search
Search npm help documentation.
Usage:
npm help-search <text>
Options:
[-l|--long]
Help:
npm help help-search
npm hook
Manage registry hooks.
Usage:
npm hook add <pkg> <url> <secret> [--type=<type>]
npm hook ls [pkg]
npm hook rm <id>
npm hook update <id> <url> <secret>
Options:
[--otp <otp>]
[--registry <registry>]
Help:
npm help hook
npm init
Create a package.json file.
Usage:
npm init <package-spec> (same as `npx <package-spec>`)
npm init <@scope> (same as `npx <@scope>/create`)
Options:
[--include-workspace-root]
[--init-author-name <name>]
[--init-author-url <url>]
[--init-license <license>]
[--init-module <module>]
[--init-version <version>]
[--no-workspaces-update]
[--scope <@scope>]
[-f|--force]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-y|--yes]
Help:
npm help init
npm install
Install a package.
Usage:
npm install [<package-spec> ...]
Options:
[--cpu <cpu>]
[--dry-run]
[--foreground-scripts]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--libc <libc>]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--os <os>]
[--package-lock-only]
[--prefer-dedupe]
[--strict-peer-deps]
[-E|--save-exact]
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help install
npm install-ci-test
Install a project with a clean slate and run tests.
Usage:
npm install-ci-test
Options:
[--dry-run]
[--foreground-scripts]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help install-ci-test
npm install-test
Install package(s) and run tests.
Usage:
npm install-test [<package-spec> ...]
Options:
[--cpu <cpu>]
[--dry-run]
[--foreground-scripts]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--libc <libc>]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--os <os>]
[--package-lock-only]
[--prefer-dedupe]
[--strict-peer-deps]
[-E|--save-exact]
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: it
Help:
npm help install-test
npm link
Symlink a package folder.
Usage:
npm link [<package-spec>]
Options:
[--dry-run]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps]
[-E|--save-exact]
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: ln
Help:
npm help link
npm ll
List installed packages.
Usage:
npm ll [[<@scope>/]<pkg> ...]
Options:
[--depth <depth>]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--json]
[--link]
[--no-unicode]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--package-lock-only]
[-a|--all]
[-g|--global]
[-l|--long]
[-p|--parseable]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: la
Help:
npm help ll
npm login
Login to a registry user account.
Usage:
npm login
Options:
[--auth-type <legacy|web>]
[--registry <registry>]
[--scope <@scope>]
Help:
npm help login
npm logout
Log out of the registry.
Usage:
npm logout
Options:
[--registry <registry>]
[--scope <@scope>]
Help:
npm help logout
npm ls
List installed packages.
Usage:
npm ls <package-spec>
Options:
[--depth <depth>]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--json]
[--link]
[--no-unicode]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--package-lock-only]
[-a|--all]
[-g|--global]
[-l|--long]
[-p|--parseable]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: list
Help:
npm help ls
npm org
Manage orgs.
Usage:
npm org set orgname username [developer | admin | owner]
npm org rm orgname username
npm org ls orgname [<username>]
Options:
[--json]
[--otp <otp>]
[--registry <registry>]
[-p|--parseable]
Alias: ogr
Help:
npm help org
npm outdated
Check for outdated packages.
Usage:
npm outdated [<package-spec> ...]
Options:
[--json]
[-a|--all]
[-g|--global]
[-l|--long]
[-p|--parseable]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help outdated
npm owner
Manage package owners.
Usage:
npm owner add <user> <package-spec>
npm owner rm <user> <package-spec>
npm owner ls <package-spec>
Options:
[--otp <otp>]
[--registry <registry>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: author
Help:
npm help owner
npm pack
Create a tarball from a package.
Usage:
npm pack <package-spec>
Options:
[--dry-run]
[--include-workspace-root]
[--json]
[--pack-destination <pack-destination>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help pack
npm ping
Ping npm registry.
Usage:
npm ping
Options:
[--registry <registry>]
Help:
npm help ping
npm pkg
Manages your package.json.
Usage:
npm pkg set <key>=<value> [<key>=<value> ...]
npm pkg get [<key> [<key> ...]]
npm pkg delete <key> [<key> ...]
npm pkg set [<array>[<index>].<key>=<value> ...]
npm pkg set [<array>[].<key>=<value> ...]
npm pkg fix
Options:
[--json]
[-f|--force]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help pkg
npm prefix
Display prefix.
Usage:
npm prefix [-g]
Options:
[-g|--global]
Help:
npm help prefix
npm profile
Change settings on your registry profile.
Usage:
npm profile enable-2fa [auth-only|auth-and-writes]
npm profile disable-2fa
npm profile get [<key>]
npm profile set <key> <value>
Options:
[--json]
[--otp <otp>]
[--registry <registry>]
[-p|--parseable]
Help:
npm help profile
npm prune
Remove extraneous packages.
Usage:
npm prune [[<@scope>/]<pkg>...]
Options:
[--dry-run]
[--foreground-scripts]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--json]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help prune
npm publish
Publish a package.
Usage:
npm publish <package-spec>
Options:
[--access <restricted|public>]
[--dry-run]
[--include-workspace-root]
[--otp <otp>]
[--provenance|--provenance-file <file>]
[--tag <tag>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help publish
npm query
Retrieve a filtered list of packages.
Usage:
npm query <selector>
Options:
[--expect-results|--expect-result-count <count>]
[--include-workspace-root]
[--package-lock-only]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help query
npm rebuild
Rebuild a package.
Usage:
npm rebuild [<package-spec>] ...]
Options:
[--foreground-scripts]
[--ignore-scripts]
[--include-workspace-root]
[--install-links]
[--no-bin-links]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: rb
Help:
npm help rebuild
npm repo
Open package repository page in the browser.
Usage:
npm repo [<pkgname> [<pkgname> ...]]
Options:
[--include-workspace-root]
[--no-browser|--browser <browser>]
[--registry <registry>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help repo
npm restart
Restart a package.
Usage:
npm restart [-- <args>]
Options:
[--ignore-scripts]
[--script-shell <script-shell>]
Help:
npm help restart
npm root
Display npm root.
Usage:
npm root
Options:
[-g|--global]
Help:
npm help root
npm run-script
Run arbitrary package scripts.
Usage:
npm run-script <command> [-- <args>]
Options:
[--foreground-scripts]
[--if-present]
[--ignore-scripts]
[--include-workspace-root]
[--script-shell <script-shell>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help run-script
npm sbom
Generate a Software Bill of Materials (SBOM).
Usage:
npm sbom
Options:
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--package-lock-only]
[--sbom-format <cyclonedx|spdx>]
[--sbom-type <library|application|framework>]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help sbom
npm search
Search for packages.
Usage:
npm search <search term> [<search term> ...]
Options:
[--color|--no-color|--color always]
[--json]
[--no-description]
[--offline]
[--prefer-offline]
[--prefer-online]
[--registry <registry>]
[--searchexclude <searchexclude>]
[--searchlimit <number>]
[--searchopts <searchopts>]
[-p|--parseable]
Help:
npm help search
npm set
Set a value in the npm configuration.
Usage:
npm set <key>=<value> [<key>=<value> ...] (See `npm config`)
Options:
[-L|--location <global|user|project>]
[-g|--global]
Help:
npm help set
npm shrinkwrap
Lock down dependency versions for publication.
Usage:
npm shrinkwrap
Help:
npm help shrinkwrap
npm star
Mark your favorite packages.
Usage:
npm star [<package-spec>...]
Options:
[--no-unicode]
[--otp <otp>]
[--registry <registry>]
Help:
npm help star
npm stars
View packages marked as favorites.
Usage:
npm stars [<user>]
Options:
[--registry <registry>]
Help:
npm help stars
npm start
Start a package.
Usage:
npm start [-- <args>]
Options:
[--ignore-scripts]
[--script-shell <script-shell>]
Help:
npm help start
npm stop
Stop a package.
Usage:
npm stop [-- <args>]
Options:
[--ignore-scripts]
[--script-shell <script-shell>]
Help:
npm help stop
npm team
Manage organization teams and team memberships.
Usage:
npm team create <scope:team> [--otp <otpcode>]
npm team destroy <scope:team> [--otp <otpcode>]
npm team add <scope:team> <user> [--otp <otpcode>]
npm team rm <scope:team> <user> [--otp <otpcode>]
npm team ls <scope>|<scope:team>
Options:
[--json]
[--otp <otp>]
[--registry <registry>]
[-p|--parseable]
Help:
npm help team
npm test
Test a package.
Usage:
npm test [-- <args>]
Options:
[--ignore-scripts]
[--script-shell <script-shell>]
Help:
npm help test
npm token
Manage your authentication tokens.
Usage:
npm token list
npm token revoke <id|token>
npm token create [--read-only] [--cidr=list]
Options:
[--cidr <cidr> [--cidr <cidr> ...]]
[--otp <otp>]
[--read-only]
[--registry <registry>]
Help:
npm help token
npm uninstall
Remove a package.
Usage:
npm uninstall [<@scope>/]<pkg>...
Options:
[--include-workspace-root]
[--install-links]
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help uninstall
npm unpublish
Remove a package from the registry.
Usage:
npm unpublish [<package-spec>]
Options:
[--dry-run]
[-f|--force]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help unpublish
npm unstar
Remove an item from your favorite packages.
Usage:
npm unstar [<package-spec>...]
Options:
[--no-unicode]
[--otp <otp>]
[--registry <registry>]
Help:
npm help unstar
npm update
Update packages.
Usage:
npm update [<pkg>...]
Options:
[--dry-run]
[--foreground-scripts]
[--global-style]
[--ignore-scripts]
[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
[--include-workspace-root]
[--install-links]
[--install-strategy <hoisted|nested|shallow|linked>]
[--legacy-bundling]
[--no-audit]
[--no-bin-links]
[--no-fund]
[--no-package-lock]
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
[--strict-peer-deps]
[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-g|--global]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help update
npm version
Bump a package version.
Usage:
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
Options:
[--allow-same-version]
[--include-workspace-root]
[--json]
[--no-commit-hooks]
[--no-git-tag-version]
[--no-workspaces-update]
[--preid prerelease-id]
[--sign-git-tag]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Alias: verison
Help:
npm help version
npm view
View registry info.
Usage:
npm view [<package-spec>] [<field>[.subfield]...]
Options:
[--include-workspace-root]
[--json]
[-ws|--workspaces]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
Help:
npm help view
npm whoami
Display npm username.
Usage:
npm whoami
Options:
[--registry <registry>]
Help:
npm help whoami
Resources
Official:
Other:
- node.green, an ECMAScript version vs Node.js version compatibility table
FAQ
What does the @ (at sign, at symbol) mean at the beginning of package names?
It refers to scope, which allows for official packages to be scoped under their name, like @grpc/grpc-js.