LinuxCommandLibrary

npm

javascript package manager

TLDR

Interactively create a package.json file

$ npm init
copy


Download all the packages listed as dependencies in package.json
$ npm install
copy


Download a specific version of a package and add it to the list of dependencies in package.json
$ npm install [package_name]@[version]
copy


Download the latest version of a package and add it to the list of dev dependencies in package.json
$ npm install [package_name] --save-dev
copy


Download the latest version of a package and install it globally
$ npm install --global [package_name]
copy


Uninstall a package and remove it from the list of dependencies in package.json
$ npm uninstall [package_name]
copy


List of locally installed dependencies
$ npm list
copy


List top-level globally installed packages
$ npm list --global --depth=[0]
copy

Copied to clipboard