Files
dotfiles/scripts/install-npm-packages.sh
Ismo Vuorinen e5d6cb37fd shell: have, path_(append|prepend|remove)
- have: command -v shorthand
- path_append: appends dir to PATH
- path_prepend: prepends dir to PATH
- path_remove: removes dir from PATH
2023-04-14 00:42:08 +03:00

37 lines
931 B
Bash
Executable File

#!/usr/bin/env bash
# Install npm packages globally.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
have npm && {
packages=(
# This is a tool to check if your files consider your .editorconfig rules.
"editorconfig-checker"
# Node module to create a release or a changelog from
# a tag and uses issues or commits to creating the release notes.
"github-release-notes"
"neovim"
"prettier"
"@bchatard/alfred-jetbrains"
"@johnnymorganz/stylua-bin"
"js-debug"
"stylelint-lsp"
"blade-formatter"
"@loopback/cli"
"corepack"
"standardjs"
)
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_run "Installing npm package:" "$pkg"
npm install -g --no-fund --no-progress --no-timing "$pkg"
echo ""
done
} || msg_err "npm could not be found."