簡介
nrm(npm registry manager )是npm的鏡像源管理工具,當國外資源太慢,可以幫助您輕鬆、快速地在不同的NPM註冊中心之間切換,現在包括:npm, cnpm, taobao, nj(nodejitsu).
安裝
$npm install -g nrm // 全局安裝nrm
查看源
$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/
切換
$nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/
測試
$nrm test taobao
* taobao - 377ms
$nrm test npm
npm ---- 1675ms
幫助
$nrm -h
Usage: cli [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 <registry> Change registry to registry
add <registry> <url> [home] Add one custom registry
set-auth [options] <registry> [value] Set authorize information for a custom registry with a base64 encoded string or username and pasword
set-email <registry> <value> Set email for a custom registry
set-hosted-repo <registry> <value> Set hosted npm repository for a custom registry to publish packages
del <registry> Delete one custom registry
home <registry> [browser] Open the homepage of registry with optional browser
publish [options] [<tarball>|<folder>] 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