nicholasadamou
9/20/2014 - 7:36 PM

a safe way to upgrade all of your globally-installed npm packages

a safe way to upgrade all of your globally-installed npm packages

#!/bin/sh

set -e
set -x

for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2)
do
    npm -g install "$package"
done
#!/bin/sh

set -e
set -x

for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
    npm -g install "$package"
done