Last active
August 15, 2016 20:33
-
-
Save jossemarGT/09a5844c8165b3106922a8c3fc71eb7d to your computer and use it in GitHub Desktop.
Tired of those "outdated" warns on your node.js project, now you have a lazy way to updated your modules. (Use with caution)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Force update for your local node modules, use with caution though | |
| OUTDATED=`npm outdated` | |
| while IFS=$'\n' read -ra item; do | |
| if [[ $item == *"Package"* ]]; then | |
| continue | |
| fi | |
| read -ra i <<< "$item" | |
| for i in "${item[@]}"; do | |
| version="${i[3]}" | |
| pkg=`echo -n "${i[0]}" | cut -d ' ' -f 1` | |
| npm install ${pkg}@${version} --force --save | |
| done | |
| done <<< "$OUTDATED" | |
| npm prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment