Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
My list of helpful node/npm/bower commands
###############################################################################
# Helpful npm commands and code snippets
###############################################################################
# list top level packages w/o dependencies
npm list --depth=0
npm list --depth=0 -g
# list top level packages that are outdated w/o dependencies
npm outdated | sort
npm outdated -g | sort
# install packages
npm install -g <pkg>@<x.x.x>
npm install -g <pkg>@latest
# update packages
npm update --save
npm update --save-dev
npm update -g <pkg1> <pkg2> <pkg3>
# Update to latest dependencies, ignore and update package.json!
npm install -g npm-check-updates
npm-check-updates
npm-check-updates -u
npm update # verify new versions work with project
# prune and rebuild
npm prune
npm rebuild
npm rebuild -g
# find package dependencies
npm ls <pkg>
# alternate tool to check and update dependencies
npm install -g david
david -g
david update -g
bower list | sort
bower update
bower prune # uninstalls local extraneous packages
# lists available tasks
grunt --help
@pzmosquito
pzmosquito commented May 18, 2016 edited

"npm outdated" shows depth 0 by default, no need to specify --depth=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment