cnpm是淘寶定制提供的命令行工具驳阎,用來替代npm脑豹。由于我國特殊的國情郑藏,使用cnpm的速度遠遠快于npm,但是也存在一些不愉快和暗病瘩欺。
今天發(fā)現(xiàn)一個工具必盖,可以管理npm倉庫,快速在各個倉庫之間切換俱饿,這個工具就是nrm歌粥。
安裝nrm
npm install -g nrm
使用nrm
在命令行界面輸入nrm,即可出現(xiàn)用法拍埠。
Usage: nrm [options] [command]
? Options:
? ? -V, --version? ? ? ? ? ? ? ? output the version number
? ? -h, --help? ? ? ? ? ? ? ? ? output usage information
? Commands:
? ? ls? ? ? ? ? ? ? ? ? ? ? ? ? List all the registries
? ? current? ? ? ? ? ? ? ? ? ? ? Show current registry name
? ? use ? ? ? ? ? ? ? Change registry to registry
? ? add [home]? Add one custom registry
? ? del ? ? ? ? ? ? ? Delete one custom registry
? ? home [browser]? ? Open the homepage of registry with optional browser
? ? test [registry]? ? ? ? ? ? ? Show response time for specific or all registries
? ? help? ? ? ? ? ? ? ? ? ? ? ? Print this help
倉庫列表
nrm ls
? npm ---- https://registry.npmjs.org/
? cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
? nj ----- https://registry.nodejitsu.com/
? rednpm - http://registry.mirror.cqupt.edu.cn/
? npmMirror? https://skimdb.npmjs.com/registry/
? edunpm - http://registry.enpmjs.org/
?切換至cnpm倉庫
nrm use cnpm
其他功能
當前倉庫名稱失驶、添加倉庫、刪除倉庫械拍、瀏覽器打開倉庫等功能突勇,詳見nrm help。