中文 | English
mto-nrm
一个便于切换注册表的库
安装
npm install mto-nrm -g
示例
- 交互式选取registry
mto-nrm ls
> npm --------------- https://registry.npmjs.org/
yarn -------------- https://registry.yarnpkg.com/
taobao ------------ https://registry.npmmirror.com/
tencent ----------- https://mirrors.cloud.tencent.com/npm/
- 命令式设置registry
mto-nrm use taobao
- 使用yarn设置registry
mto-nrm use taobao -e yarn
使用
Usage: mto-nrm [options] [command]
A library for easy switching of the npm registry
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
ls [options] interactive selection registry
use [options] <name> command selection registry
get [options] [name] get registry
set [options] <name> set registry
home [options] [name] view registry home
view [options] [name] view registry
add <name> <url> [home] add registry
update [options] <name> update registry
del <name> delete registry
clear clear registry
test [options] [nameOrUrl] test registry
config get config file path
help [command] display help for command
get
- 获取registry
mto-nrm get
- 获取指定registry
mto-nrm get taobao
set
- 设置registry
mto-nrm set https://registry.npmmirror.com/
home
- 获取home
mto-nrm home
- 获取指定home
mto-nrm home taobao
view
- 查看registry
mto-nrm view
- 查看指定registry
mto-nrm view taobao
add
- 添加registry
mto-nrm add cnpm http://r.cnpmjs.org/ http://r.cnpmjs.org/
update
- 更新registry
mto-nrm update cnpm -u=http://r.cnpmjs.org/ -h=http://r.cnpmjs.org/
del
- 删除registry
mto-nrm del cnpm
clear
- 清空registry
mto-nrm clear
test
- 测试registry
mto-nrm test
- 测试指定registry
mto-nrm test taobao
config
- 获取配置文件路径
mto-nrm config
Node使用
import mtonrm from 'mto-nrm'
mtonrm.use('taobao')
开源许可证
Copyright (c) 2023 Matrix-The-One