a cli tool to get/set/switch npm registry
- nodejs>=6.9
- npm
- Windows
- Linux
- MacOS
npm install @axetroy/nmr -g
nmr -h
Usage: nmr <command> [options]
Commands:
set|s <registry> set registry
get|g get registry
reset|r [options] reset to npm official registry
list|ls print out the registries
Npm Mirror Registry, handle npm registry in a easy way
Options:
-h, --help output usage information
-V, --version output the version number
const co = require('co');
const npmRegistrySwitch = require('@axetroy/nmr');
co(function*() {
yield npmRegistrySwitch.get(); // https://registry.npmjs.org
yield npmRegistrySwitch.set("https://registry.npm.taobao.org");
yield npmRegistrySwitch.get(); // https://registry.npm.taobao.org
yield npmRegistrySwitch.reset();
yield npmRegistrySwitch.get(); // https://registry.npmjs.org
}).catch(function(err) {
console.error(err);
})
Cause i hate type npm config set registry https://xxxxxxxx
npm's network is terrible, we gonna set the mirror registry like cnpm in China.
but, if we set mirror registry, then i can't use npm service anymore, like npm publish, npm whoami, npm login
if you want use it agian, you gonna set to npm official registry.
such as said, I hate type npm config set registry https://xxxxxxxx
git clone https://github.com/axetroy/nmr.git
cd ./nmr
yarn
./bin/nmr
You can flow Contribute Guide
Contributors | Commit | Add Code | Remove Code | Total Changes |
axetroy | 19 | +3962(95.47%) | -141(3.40%) | 4103(98.87%) |
wd | 2 | +22(0.53%) | -9(0.22%) | 31(0.75%) |
WindomZ | 2 | +9(0.22%) | -7(0.17%) | 16(0.39%) |
The MIT License