mini-nrm 一个超轻量级的 NPM 镜像管理工具

2022-10-26 11:23:32 +08:00
 lete

前言

前端真卷,都在不停的造轮子,没办法,都是为了更小更轻便

比如:

也不能说是卷吧,比如造汽车,都有那么多汽车品牌了,为什么小米、华为也要来造汽车,总的来说,可能别人造的有些功能不是很喜欢,或者用着不爽,完了自己还不能自定义,那就造吧!!!

mini-nrm

超轻量级 npm 注册表管理器

Install

npm install -g mini-nrm

由于它很小,你也可以不安装直接使用

npx mini-nrm use tencent

Usage

mnrm -h: 显示帮助列表

  Usage
    $ mnrm [options]
  Options
    ls, list                          列举所有的镜像列表
    use <name>                        切换镜像
    add <name> <registry> [home]      添加自定义镜像
    test [-i, --info]                 测试所有镜像的响应速度
    del, delete, rm, remove <name>    删除自定义镜像
    h, -h, help, --help               显示帮助列表
  Examples

    $ mnrm add npm https://registry.npmjs.org/
    # or
    $ mnrm add npm https://registry.npmjs.org/ https://www.npmjs.org

    $ mnrm use npm

    $ mnrm list

      * npm --------- https://registry.npmjs.org/
        yarn -------- https://registry.yarnpkg.com/
        taobao ------ https://registry.npmmirror.com/
        tencent ----- https://mirrors.cloud.tencent.com/npm/
        npmMirror --- https://skimdb.npmjs.com/registry/
        github ------ https://npm.pkg.github.com/

    $ mnrm test

      * npm --------- 153 ms
        yarn -------- 175 ms
        taobao ------ 519 ms
        tencent ----- 121 ms
        npmMirror --- 481 ms
        github ------ 169 ms

JavaScript API

import mnrm from 'mini-nrm'

console.log(mnrm.list())
// output
// * npm --------- https://registry.npmjs.org/
//   yarn -------- https://registry.yarnpkg.com/
//   taobao ------ https://registry.npmmirror.com/
//   tencent ----- https://mirrors.cloud.tencent.com/npm/
//   npmMirror --- https://skimdb.npmjs.com/registry/
//   github ------ https://npm.pkg.github.com/
1320 次点击
所在节点    JavaScript
6 条回复
lete
2022-10-26 11:34:21 +08:00
creanme
2022-10-26 11:48:11 +08:00
推荐一下 grm
lete
2022-10-26 12:03:39 +08:00
@creanme 找不到唉
creanme
2022-10-26 12:06:35 +08:00
lete
2022-10-26 12:22:55 +08:00
@creanme 看了一下确实不错,但还是比 mnrm 大,grm ~ 1MB

优点:不需要 nodejs(但谁用 npm 不用 nodejs ?)
lllyglh
2022-10-28 10:15:32 +08:00
支持楼主,很方便切换镜像

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/889953

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX