Useful NPM global packages

April 07, 2019

When it’s a package that I’ll use infrequently, such as create-react-app, I’ll reach to npx. However, there’s a few packages I use again and again so are worth the npm i -g.


npm i -g npm-check
npm-check -u
npm-check -ug

Check for outdated, incorrect and unused dependencies. The -u arg gives you an interactive tool.


npm i -g typescript
tsc my-file.ts

Typescript compiler.


npm i  -g http-server
http-server [path]

Quickly serve a directory through localhost:8080 with zero-config.


npm i -g netlify-cli
netlify deploy

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 rimraf
rimraf [path]

It’s rm -rf but works where ever you have node - macOS, Windows, WSL, node.


npm i -g tinypng-cli
tinypng myimage.jpg

You’ve used the website, now use the cli!

List globally installed packages

Run this command to see a list what you have installed globally

npm ls -g --depth=0

Duncan McDougall is freelance web developer from Annan, Scotland.
LinkedIn GitHub Twitter