nrm(镜像源管理工具)
nrm(npm registry manager )
是npm
的镜像源管理工具,可以查看已有的镜像源,如npm
cnpm
yarn
等.
允许你快速使用nrm
切换下载源。
1、安装nrm
npm install -g nrm
2、查看下载镜像源
nrm ls
输出如下
* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
其中,带*
的是当前使用的源,上面的输出表明当前源是官方源
3、切换镜像源
nrm use yarn
4、删除对应的源
nrm del npm
5、测试相应源的响应时间
nrm test yarn
Administrator@DESKTOP-Q6869A5 MINGW64 ~/Desktop
$ nrm test npm
npm ---- 2698ms
Administrator@DESKTOP-Q6869A5 MINGW64 ~/Desktop
$ nrm test cnpm
cnpm --- 180ms
Administrator@DESKTOP-Q6869A5 MINGW64 ~/Desktop
$ nrm test yarn
* yarn --- 761ms
Administrator@DESKTOP-Q6869A5 MINGW64 ~/Desktop
$ nrm test taobao
taobao - 142ms