Node Package Manager - npm, Performant npm (pnpm)
# Install dependenciesnpm install
# Run testsnpm test
# Update dependenciesnpm update
# Update global (-g) packagesnpm update -g
# Install a global (-g) package to be available in pathnpm install -g prettier
# List install packagesnpm ls
# Uninstall a packagenpm uninstall package_name
# NPM proxy setting# per https://medium.com/@ogbemudiatimothy/using-npm-install-behind-a-corporate-proxy-server-db150c128899npm config set proxy http://1.1.1.1:3128npm config set https-proxy http://1.1.1.1:3128
# Remove proxynpm config rm proxynpm config rm https-proxy
# Run command from a local or remote rpm packagenpx [args]
# npm exec Check project files with ESLint version in projectnpx eslint ./*.js
# Clean npm cachenpm cache clean --forcePerformant npm (pnpm)
Section titled “Performant npm (pnpm)”# Install global package(s)pnpm add -g <pkg>pnpm add -g typescript prettier eslint
# Update global packages## List thempnpm outdated -g## then updatepnpm update -g --latest
# Interactively create a package.json filepnpm init
# Download all the packages listed as dependencies in package.jsonpnpm install
# Download a specific version of a package and add it to the list of dependencies in package.jsonpnpm install {{module_name}}@{{version}}
# Download a package and add it to the list of dev dependencies in package.jsonpnpm install --dev {{module_name}}
# Download a package and install it globallypnpm install -g {{module_name}}
# Uninstall a package and remove it from the list of dependencies in package.jsonpnpm uninstall {{module_name}}
# Print a tree of locally installed modulespnpm list
# List top-level [g]lobally installed modulespnpm list -g --depth={{0}}Angular
Section titled “Angular”# Install dependencies including Angularnpm install
# NPM Execute (npx) to run a local or remote npm package, Angular CLI buildnpx ng build# Run angular CLI set up in the project# Requires npm install first
# Run testnpx ng test
# Run applicationnpx ng serve