Created
October 17, 2014 10:24
-
-
Save simong/4aa95363e21ce486c1f3 to your computer and use it in GitHub Desktop.
Sort your npm dependencies on when they were last published
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/sh | |
| # Get all the non-git, non-oae modules | |
| modules=$(npm ls --depth=0 | grep -v git | grep -v oae- | cut -f 2 -d ' ') | |
| for module in $modules ; do | |
| name=$(echo $module | cut -f 1 -d '@') | |
| version=$(echo $module | cut -f 2 -d '@') | |
| # Get the timestamp | |
| echo $published=$(npm show $module | grep "'$version': '" | cut -f 4 -d "'") $module >> /tmp/published.txt | |
| # Give an indication of where we're at | |
| echo $published $module | |
| done | |
| # Sort them | |
| cat /tmp/published.txt | sort | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment