Using npm and git behind proxy

How to proxy npm and git when download packages? You can using bash like this...

You can config npm like this

1
2
3
4
5
6
7
// set proxy
$ npm config set proxy http://host:port
$ npm config set https-proxy http://host:port

// delete proxy
$ npm config delete proxy
$ npm config delete https-proxy

and git config using --global

1
2
git config --global http.proxy http://host:port
git config --global https.proxy http://host:port