When it's a package that I'll use infrequently, such as create-react-app, I'll use
npx. However, there's a few utility packages I use again and again that are worth the
npm i -g.
npm i -g npm-check
Check for outdated, incorrect and unused dependencies. The -u arg gives you an interactive tool.
npm i -g rimraf
rm -rf but works where ever you have node - macOS, Windows, WSL, node.
npm i -g http-server
Quickly serve a directory through localhost:8080 with zero-config.
npm i -g netlify-cli
Deploy a site to Netlify from the command line. I'll use this to throw up temporary site when I need to demo work in progress to team mates.
npm i -g tinypng-cli
You've used the website, now use the cli!
npm i -g nodemon
This will run your node and will automatically restart if it detects files changes in the directory. Great to have installed globally for quick scripts. It should be into an application locally if it's part of the development workflow.
List globally installed packages
Run this command to see a list what you have installed globally
npm ls -g --depth=0