Proper npm Global Package Upgrade

Proper npm Global Package Upgrade

Per the npm documentation, this is the script to use:

Here's the gist

#!/bin/sh

set -e
set -x

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