FlintSable
5/28/2017 - 9:06 PM

Node Package Manager

Node Package Manager

install package:
npm install pkg
npm i pkg

install globally:
npm i --global pkg
npm i -g pkg

install package save as depencency
npm i --save pkg
npm i -S pkg@version

install package, save as devDependency
npm i --save-dev pkg
npm i -D pkg

uninstall package
npm uninstall -g packageName
windows: %AppData%\npm\node_modules
Unix: /usr/local/lib/node_modules

list scripts:
cat package.json
npm run

list installed packages:
npm ls --depth 0

list gloably-installed:
npm ls -g --depth 0

test:
npm t
More useful tricks

https://medium.freecodecamp.com/8-npm-tricks-you-can-use-to-impress-your-colleagues-dbdae1ef5f9e