config/.config/fish/functions/npm_upgrade.fish

13 lines
378 B
Fish

function npm_upgrade --description "Upgrade npm packages"
set --local npm_pkgs_outdated (npm outdated -g | awk 'NR > 1 {print $1}')
if test (count $npm_pkgs_outdated) -eq 0
echo "All packages up-to-date."
else
echo "Outdated packages: $npm_pkgs_outdated"
if confirm "Continue with upgrade?"
npm update -g
end
end
end