7 examples for npm

{{ score }}
  # Reduce duplication of dependencies
npm dedupe
        
{{ score }}
  # install a node package globally
npm install -g 
        
{{ score }}
  # install a node package into local node project
npm install 
        
{{ score }}
  # Install node package into local node project and save the package and version into package.json
npm install --save 
        
{{ score }}
  # List all versions of a package hosted on npmjs
npm view  versions
        
{{ score }}
  # Create a globally-installed sybolic link to the cwd
# allowing local development and simultaneous consumption
# of modules
#
# Linking is a two-step process
#
# 1) in package dir:
npm link

# alias: npm ln
#
# 2) in some other location:
npm link package-name

# which creates a sybolic link from the local node_modules
# folder to the global symlink
#
# Note that `package-name` is taken from package.json, not
# directory name
#
# See https://docs.npmjs.com/cli/link
        
{{ score }}
  # install dev dependencies in local
npm i  --save-dev

npm i  -D
# install Dev dependencies in global
(sudo) npm i -g  -D 

# install global package
npm i -g