Skip to content

Instantly share code, notes, and snippets.

@mayoralito
Created May 25, 2019 17:14
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 mayoralito/a0afee85b69597501e456771d5a25b26 to your computer and use it in GitHub Desktop.
Save mayoralito/a0afee85b69597501e456771d5a25b26 to your computer and use it in GitHub Desktop.
# Get all packages and save it to ENV variable
PACKAGES_TO_UPDATE=`npm outdated | awk '{print "npm install", $1"@latest", "--save; \n\r" }'`
# Save output to a location
echo $PACKAGES_TO_UPDATE > /tmp/npm-update-packages.log
# Open the file and remove the first line
# TODO: use awk to remove the first line of the file
vim /tmp/npm-update-packages.log
# Copy the content of the file and paste it on the terminal
# TODO: Create an script to get the output from npm outdated command and run the update against the latest version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment