1
mirror of https://github.com/jakejarvis/dotfiles.git synced 2025-11-04 22:10:09 -05:00
This commit is contained in:
2021-03-17 10:57:41 -04:00
parent f1e8bddb4a
commit 5953542014
12 changed files with 229 additions and 184 deletions

24
npm/npm-globals.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
### Install global npm packages listed in npm-globals.txt
# https://github.com/br3ndonland/dotfiles/blob/main/script/npm-globals.sh
set -euo pipefail
package_dir="$(npm config get prefix)/lib"
packages=$(npm ls -g --parseable --depth=0)
packages=${packages//$package_dir\/node_modules\//}
echo "* Installing global npm packages..."
while read -r p; do
installed=$(echo "$packages" | grep -ce "^$p\$")
if [ "$installed" == "0" ]; then
echo "Installing $p..."
npm install -g "$p" || echo "!! Error: package $p not found in npm."
else
echo "$p is already installed."
fi
done <~/.dotfiles/npm/npm-globals.txt
echo "* Done installing npm packages."

23
npm/npm-globals.txt Normal file
View File

@@ -0,0 +1,23 @@
@babel/cli
@babel/core
@lhci/cli
autoprefixer
eslint
express-generator
express
firebase-tools
gatsby-cli
gulp
json-server
netlify-cli
newman
nodemon
npm-check
postcss-cli
postcss
prettier
standard
stylelint
vercel
webtorrent-cli
yo