Skip to content

Instantly share code, notes, and snippets.

@glenpike
Last active February 1, 2017 15:27
Show Gist options
  • 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