feat(plugin): add npm
This commit is contained in:
parent
f6002e0668
commit
75fb0068a0
1 changed files with 24 additions and 0 deletions
24
plugins/npm
Normal file
24
plugins/npm
Normal file
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# npm
|
||||
#
|
||||
|
||||
# Install NPM packages globally without requiring sudo
|
||||
# https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
|
||||
if command -v npm &> /dev/null; then
|
||||
|
||||
# Use XDG dirs
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/config"
|
||||
export NPM_CONFIG_CACHE="$XDG_CACHE_HOME/npm"
|
||||
export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR/npm"
|
||||
export NPM_CONFIG_PREFIX="$XDG_DATA_HOME/npm"
|
||||
|
||||
# add npm binary directory to PATH
|
||||
path+=("$NPM_CONFIG_PREFIX/bin")
|
||||
export PATH
|
||||
|
||||
# Rare, but some npm packages install man pages...
|
||||
MANPATH="$NPM_CONFIG_PREFIX/share/man:$(manpath)"
|
||||
export MANPATH
|
||||
fi
|
||||
|
||||
# vim: ft=zsh expandtab tabstop=2 shiftwidth=2
|
Loading…
Reference in a new issue