Skip to content

Instantly share code, notes, and snippets.

@lukaszewczak
Last active February 17, 2019 04:32
Show Gist options
  • Save lukaszewczak/e58838af91e2c7e8ff0e11d892f5e915 to your computer and use it in GitHub Desktop.
Save lukaszewczak/e58838af91e2c7e8ff0e11d892f5e915 to your computer and use it in GitHub Desktop.
Update all package.json dependencies

Sometimes, when working with tutorials, I just want to update all of the project depedencies, so this how I do it.

node -p "const json=require('./package.json');const depedencies=Object.keys(json.dependencies).reduce((prev,item)=>`${prev} ${item}@latest`,''); require('child_process').exec(`npm install ${depedencies}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment