Last active
December 8, 2021 12:40
-
-
Save garystafford/d540540b6863e4ab6200 to your computer and use it in GitHub Desktop.
My list of helpful node/npm/bower commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"npm outdated" shows depth 0 by default, no need to specify --depth=0