shell-base/lang/node
David Kebler 0ac5906eee refactor the way the module library is loaded
added startup script callable from profile.d
renamed setup.sh to load.sh
added rsync copy function cprs
added shell.env that is called by /etc/profile to set up access to this  and related repos
2020-11-13 10:25:04 -08:00

54 lines
2.2 KiB
Bash

#!/bin/bash
if command -v node >/dev/null 2>&1; then
# echo addding node langauge stuff
# gives access to packages with bin in a project
path_append ./node_modules/.bin
path_append /opt/node-global-apps/bin
export NPM_REGISTRY=https://npm.kebler.net
alias nr="npm run"
alias nrs="npm -s run"
alias nt="npm -s test"
alias ntw="npm -s run testw"
alias npms="npm start"
alias npmlag="npm la --silent --depth=0 --global"
alias npmla="npm la --silent --depth=0"
alias npmlaf="npm la --silent | grep"
alias npmlsg="npm ls --silent --depth=0 --global"
alias npmlsf="npm ls --silent grep"
alias npmlsa="npm ls --silent"
alias npmls="npm ls --silent --depth=0"
# just npm install for install without saving into package.json
alias npmi="npm install --save"
alias npmr="npm uninstall --save"
alias npmio="npm install --save-optional"
alias npmro="npm uninstall --save-optional"
alias npmidv="npm install --save-dev"
alias npmidvnd="npm install --save-dev --package-lock-only --no-package-lock"
alias npmrdv="npm uninstall --save-dev"
alias npmig="npm install -g"
alias snpmig="sudo npm install -g"
alias npmrg="npm uninstall -g"
alias snpmrg="npm uninstall -g"
alias npmunpm="echo npm installed version && npm --version && echo npm latest version available && npm view npm@latest version && echo any key to continue npm upgrade or break && read && npm install -g npm@latest"
alias npmua="npm --depth=9999 update"
alias npmug="npm-check -g -u"
alias npmu="npm-check -u"
alias npmcc="ncu -p -a -u"
alias npmcdvc="ncu -d -a -u"
alias npmc="ncu -p"
alias npma="npm-add-dependencies"
# will publish to whichever is the default registry - confusing so commented out
# alias npmpub="npm publish --access public"
alias npmlrepub="npm publish --registry http://localhost:4873 --force --access restricted"
alias npmlpub="npm publish --registry http://localhost:4873 --access restricted"
alias npmnrepub="npm publish --registry https://npm.kebler.net --force --access restricted"
alias npmnpub="npm publish --registry https://npm.kebler.net --access restricted"
alias npmjspub="npm publish --registry https://registry.npmjs.org --access public"
alias yalcpush="nodemon -x 'yalc push'"
# else
# echo "node not installed, npm aliases not loaded"
fi