文档
- github https://github.com/Pana/nrm
- npmjs https://www.npmjs.com/package/nrm
# 设置源
$ npm set registry https://registry.npm.taobao.org/
# 查看npm源
$ npm config ls
使用nrm管理npm源
安装
$ npm install -g nrm
查看帮助
$ nrm -h
Usage: nrm [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
ls List all the registries
current [options] Show current registry name or URL
use Change registry to registry
add [home] Add one custom registry
login [options] [value] Set authorize information for a custom registry with a base64 encoded string or username and pasword
set-hosted-repo Set hosted npm repository for a custom registry to publish packages
set-scope Associating a scope with a registry
del-scope Remove a scope
set [options] Set custom registry attribute
rename Set custom registry name
del Delete one custom registry
home [browser] Open the homepage of registry with optional browser
publish [options] [|] Publish package to current registry if current registry is a custom registry.
if you're not using custom registry, this command will run npm publish directly
test [registry] Show response time for specific or all registries
help Print this help
if you want to clear the NRM configuration when uninstall you can execute "npm uninstall nrm -g -C or npm uninstall nrm -g --clean"
使用
# 查看源列表
$ nrm ls
npm ---------- https://registry.npmjs.org/
yarn --------- https://registry.yarnpkg.com/
tencent ------ https://mirrors.cloud.tencent.com/npm/
cnpm --------- https://r.cnpmjs.org/
taobao ------- https://registry.npmmirror.com/
npmMirror ---- https://skimdb.npmjs.com/registry/
# 使用源
$ nrm use cnpm
Registry has been set to: https://r.cnpmjs.org/
参考 nrm详解