Skip to content

Instantly share code, notes, and snippets.

@glenpike
Last active February 1, 2017 15:27
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 glenpike/4fefb9d195c01637ce9056f1143e4013 to your computer and use it in GitHub Desktop.
Save glenpike/4fefb9d195c01637ce9056f1143e4013 to your computer and use it in GitHub Desktop.
List all global npm packages when you want to install them with a new nvm version
#list top level packages, extract the package name, remove the .nvm line, remove the version number, reduce to single line
npm ls -g --depth=0 | cut -d ' ' -f2 | grep -v '.nvm' | sed -e 's/@.*//' | tr '\n' ' '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment