cgr 同时管理npm、yarn源

cgr 同时管理npm、yarn源


Install

$ npm install -g cgr

例子

$ cgr ls  //* for both

  npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npmmirror.com/
  yarn --- https://registry.yarnpkg.com/
# taobao前 * 表示npm和yarn都是用taobao源
$ cgr ls  //N for npm, Y for yarn, P for pnpm

N npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
Y taobao - https://registry.npmmirror.com/
  yarn --- https://registry.yarnpkg.com/

$ cgr use cnpm  //both switch registry to cnpm

    npm registry has been set to: http://r.cnpmjs.org/
    yarn registry has been set to: http://r.cnpmjs.org/

$ cgr use cnpm y  //yarn switch registry to cnpm

    yarn registry has been set to: http://r.cnpmjs.org/

$ cgr use cnpm n  //npm switch registry to cnpm

    npm registry has been set to: http://r.cnpmjs.org/

$ cgr on pnpm  //enable pnpm switch registry

    cgr enable pnpm success

$ cgr off pnpm  //disable pnpm switch registry

    cgr disable pnpm success

$ cgr use cnpm p  //pnpm switch registry to cnpm

    pnpm registry has been set to: http://r.cnpmjs.org/

用法

Usage
Usage: cgr [options] [command]

  Commands:

    ls                           List all the registries
    use <registry> [type]        Change registry to registry
    add <registry> <url> [home]  Add one custom registry
    del <registry>               Delete one custom registry
    test [registry]              Show the response time for one or all registries
    on [type]                    Enable pnpm or other type
    off [type]                   Disable pnpm or other type
    help                         Print this help

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

参考链接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值