Skip to content

Instantly share code, notes, and snippets.

@illvart
Last active March 23, 2020 18:56
Show Gist options
  • Save illvart/50aa064917377db99171a405e02716bc to your computer and use it in GitHub Desktop.
Save illvart/50aa064917377db99171a405e02716bc to your computer and use it in GitHub Desktop.
Install global node.js packages from packages.txt

Install global node.js packages from packages.txt

Create bash script

npm npm-global-install.sh:

#!/usr/bin/env bash

cat packages.txt | xargs npm install --global

yarn yarn-global-add.sh:

#!/usr/bin/env bash

cat packages.txt | xargs yarn global add

~/.bashrc or ~/.zshrc:

# npm
# export PATH="$(npm bin --global):$PATH"
export PATH="$PATH:$HOME/.npm-global/bin"

# yarn
# export PATH="$(yarn global bin):$PATH"
export PATH="$PATH:$HOME/.yarn-global/bin"

Run source ~/.bashrc or source ~/.zshrc.

~/.npmrc:

prefix=/home/illvart/.npm-global
cache=/home/illvart/.npm-global/cache

~/.yarnrc:

prefix "/home/illvart/.yarn-global"
cache-folder "/home/illvart/.yarn-global/cache"
global-folder "/home/illvart/.yarn-global"
#!/usr/bin/env bash
cat packages.txt | xargs npm install --global
n
nrm
np
npm-check
npm-upgrade
ntl
nodemon
depcheck
npkill
cost-of-modules
semantic-release-cli
pkg
@babel/core
@babel/cli
buble
esbuild-linux-64
lebab
prettier
cpy-cli
rimraf
del-cli
trash-cli
empty-trash-cli
delay-cli
make-dir-cli
move-file-cli
clipboard-cli
cash-cli
speed-test
emoj
capture-website-cli
pageres-cli
is-up-cli
vtop
gtop
fkill-cli
kill-tabs
public-ip-cli
internal-ip-cli
wifi-password-cli
iponmap
diff-so-fancy
carbon-now-cli
dev-time-cli
torrent
http-server
serve
gulp-cli
grunt-cli
firebase-tools
now
gatsby-cli
pen
#!/usr/bin/env bash
cat packages.txt | xargs yarn global add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment