- This warehouse use for reference from Official Warehouse:https://github.com/Pana/nrm
- 简体中文 | English
$ npm install inrm -g
- 1、You can use 'nrm xxx'
$ nrm ls
$ nrm list
$ nrm ping
$ nrm test
$ nrm now
- 2、You also can use 'inrm xxx'
$ inrm ls
$ inrm list
$ inrm ping
$ inrm test
$ inrm now
- The following example takes the 'nrm' command this example
- You also can use the 'inrm' command to
$ nrm
Usage: nrm [options] [command]
Options:
-v, --version Output the version number
-h, --help Output usage information
Commands:
ls|list List all the registries
add <name> <url> [home] Add one custom registry
use <name> Change registry to registry
rename <name> <newName> Set custom registry name
ping|test [name] Show the response time for one or all registries, default to all registries
del|delete <name> Delete one custom registry
home <registry> [browser] Open the homepage of registry with optional browser
set <manager-name> <name> Set the registries for other package managers,like: npm、yarn、cnpm、pnpm
now [manager-name] Display the registries used by the package manager, default to all package managers
$ nrm list
┌──────┬────────────┬──────────────────────────────────────────────┐
│ used │ name │ registries url │
├──────┼────────────┼──────────────────────────────────────────────┤
│ * │ npm │ https://registry.npmjs.org/ │
│ - │ cnpm │ https://registry.npmmirror.com/ │
│ - │ yarn │ https://registry.yarnpkg.com/ │
│ - │ tencent │ https://mirrors.cloud.tencent.com/npm/ │
│ - │ huawei │ https://repo.huaweicloud.com/repository/npm/ │
│ - │ npmMirror │ https://skimdb.npmjs.com/registry/ │
│ - │ github │ https://npm.pkg.github.com/ │
│ - │ ustc │ https://npmreg.proxy.ustclug.org/ │
└──────┴────────────┴──────────────────────────────────────────────┘
$ nrm add yourName http://www.your-registry.com/
成功: 添加注册表 yourName 成功,运行 nrm use yourName 命令以使用yourName镜像源!
$ nrm use yourName
成功: 镜像源已更改为yourName
$ nrm rename yourName myName
成功: 镜像源名称从 yourName 更改为 myName
3.6、Show the response time for one or all registries, default to all registries('nrm ping' or' nrm test')
- 1、default to all registries
$ nrm ping
┌──────┬────────────┬────────────────────────────────────────────────┐
│ used │ name │ response time │
├──────┼────────────┼────────────────────────────────────────────────┤
│ - │ npm │ 896 ms │
│ - │ cnpm │ 132 ms │
│ - │ yarn │ 761 ms │
│ - │ tencent │ 563 ms │
│ - │ huawei │ 63 ms │
│ - │ npmMirror │ 1206 ms │
│ - │ github │ 584 ms(获取错误,若这是您的私人镜像源,请忽略) │
│ - │ ustc │ 1223 ms │
│ * │ myName │ 39 ms(获取错误,若这是您的私人镜像源,请忽略) │
└──────┴────────────┴────────────────────────────────────────────────┘
- 2、npm registries
$ nrm ping npm
┌──────┬────────────┬────────────────────────────────────────────────┐
│ used │ name │ response time │
├──────┼────────────┼────────────────────────────────────────────────┤
│ - │ npm │ 896 ms │
└──────┴────────────┴────────────────────────────────────────────────┘
- Delete used registry
$ nrm del myName
成功: 已成功删除镜像源myName
成功: 镜像源已更改为'npm'
- Delete other registry
$ nrm del myName
成功: 已成功删除镜像源myName
$ nrm home npm
成功: 正在打开当前镜像源主页,请看浏览器!
$ nrm set yarn yarn
成功: yarn 包管理器的镜像源设置成 https://registry.npmmirror.com/
- 1、 default to all package managers
$ nrm now
┌──────┬──────────┬───────────────────────────────┐
│ used │ package │ package managers │
├──────┼──────────┼───────────────────────────────┤
│ × │ cnpm │ - │
│ × │ pnpm │ - │
│ √ │ yarn │ https://registry.yarnpkg.com/ │
│ √ │ npm │ https://registry.npmjs.org/ │
└──────┴──────────┴───────────────────────────────┘
- 2、yarn package managers
$ nrm now yarn
┌──────┬──────────┬───────────────────────────────┐
│ used │ package │ package managers │
├──────┼──────────┼───────────────────────────────┤
│ √ │ yarn │ https://registry.yarnpkg.com/ │
└──────┴──────────┴───────────────────────────────┘
MIT