Skip to content

Instantly share code, notes, and snippets.

@gotofritz
Last active October 19, 2017 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotofritz/2ecd22634fa4045fd6ef69c1a2031c62 to your computer and use it in GitHub Desktop.
Save gotofritz/2ecd22634fa4045fd6ef69c1a2031c62 to your computer and use it in GitHub Desktop.
NPM bits and pieces
# given that $PACKAGE is the package about which you want to find out more
# this lists only the modules you have installed
npm ls
# list available versions of $PACKAGE
# note the plural, versionS - without it, you only get the current version
npm show $PACKAGE versions
# this finds the latest version of your package as well as other with similar names
npm search $PACKAGE
# the output, however, is unreadable if the package uses long version numbers like 1.0.0-beta.17.2
# in that case the following is slightly better, although messier
npm search $PACKAGE --parseable --no-description
# gives you all the info from the npm registry about $PACKAGE
npm view $PACKAGE
# only gives you the versions field of that info - the same applies to description, etc
npm view $PACKAGE versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment