-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnode.sh
executable file
·69 lines (58 loc) · 1.29 KB
/
node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# Setup Node install global packages
# Requires: asdf and asdf-nodejs
debug=${1:-false}
# Load help lib if not already loaded.
if [ -z ${libloaded+x} ]; then
source ./lib.sh
fi;
# Check if asdf is installed.
if hash asdf 2>/dev/null; then
botintro "Installing Node global packages."
# Create dirs and set current user as owner (prevent sudo issues)
action "Creating Node directories"
sudo mkdir "/usr/local/lib/node_modules"
sudo chown -R $(whoami) "/usr/local/lib/node_modules"
# Update npm for LTS.
# note: node is installed by asdf from .tool-versions
action "Updating npm."
npm install npm -g
# Install global Node packages.
action "Installing Node global packages."
packages=(
create-react-app
caniuse-cmd
dependency-cruiser
doctoc
eslint
fast-folder-size
git-open
git-recent
gzip-size-cli
http-server
imageoptim-cli
is-up-cli
lighthouse
npm-check
npm-home
npm-name-cli
pageres-cli
prettier
remote-share-cli
serve
source-map-explorer
speed-test
stylelint
stylelint-config-standard
surge
svgo
viewport-list-cli
@vue/cli
)
for package in ${packages[@]}; do
npm install --global $package
done
# fin.
else
echo "WARNING: asdf not found."
fi;