add `npm` wrapper which strips background colours by davidchambers · Pull Request #1 · davidchambers/dotfiles

2 min read Original article ↗

Skip to content

Navigation Menu

Conversation

@davidchambers

The wrapper is only used when npm is run directly from the shell. To work in all cases, the npm function needs to be moved to a PATH-accessible script.

@davidchambers davidchambers changed the title .bashrc: define npm wrapper which strips background colours add npm wrapper which strips background colours

Apr 27, 2014

@davidchambers

I moved the body of the npm function to ~/bin/npm and appended ~/bin to PATH, so the wrapper is now used when npm is run from within a script.

davidchambers added a commit that referenced this pull request

Apr 27, 2014
add `npm` wrapper which strips background colours

@leakyMirror

It seems this is what I am looking for, but I am not sure how to use it. Could you please add a short instruction?

@davidchambers

Here are the steps to mirror my set-up:

$ cd ~
$ mkdir -p bin
$ curl https://raw.githubusercontent.com/davidchambers/dotfiles/master/bin/npm >bin/npm
$ chmod +x bin/npm
$ echo 'export PATH="$HOME/bin:$PATH"' >>.bashrc
$ source .bashrc

Note that the file needn't live at ~/bin/npm; it can live anywhere on your PATH. I keep it in ~/bin so it can live in this repository.

@leakyMirror

2 participants

@davidchambers @leakyMirror