UNPKG

3.17 kBMarkdownView Raw
1<h1 align="center">mini-nrm</h1>
2<p align="center">Mini npm registry manager</p>
3
4<p align="center">
5 <a href="https://www.npmjs.com/package/mini-nrm"><img src="https://img.shields.io/npm/v/mini-nrm?logo=npm" alt="Version"></a>
6 <a href="https://github.com/Lete114/visitor-badge"><img src="https://visitor_badge.deta.dev/?pageID=github.CreateWheel.mini-nrm" alt="visitor_badge"></a>
7 <a href="https://github.com/CreateWheel/mini-nrm/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/mini-nrm?color=FF5531" alt="MIT License"></a>
8</p>
9
10# mini-nrm
11
12Super lightweight npm registry manager
13
14- **No dependencies.**
15- [mini-nrm](https://packagephobia.com/result?p=mini-nrm) ~ **21kB** | [nnrm](https://packagephobia.com/result?p=nnrm) ~ **7MB** | [nrm](https://packagephobia.com/result?p=nrm) ~ **15MB**
16- Customizing the registry image
17- Test response speed details
18- TypeScript type declarations included.
19<p align="center">
20<img src="images/mini-nrm.gif" style="width: 80%;">
21</p>
22
23## Install
24
25```bash
26npm install -g mini-nrm
27```
28
29Because it is very slim, you can use `npx` to manage the registry image directly without installing it
30
31```bash
32npx mini-nrm --help
33```
34
35## Usage
36
37> This command does not modify the registry, it just uses the specified registry to install the dependencies
38>
39> It uses the `taobao` registry to install `output-line` `get-user-ip ` `body-data` `simple-unique`
40```diff
41-npm install output-line get-user-ip body-data simple-unique -S
42+mnrm use taobao output-line get-user-ip body-data simple-unique -S
43```
44
45`mnrm --help`: Show this help
46
47```bash
48 Usage
49 $ mnrm [options]
50 Options
51 ls, list List all the registries
52 use <name> [package...] Switch registry or specify registry directly to install npm packages
53 add <name> <registry> [home] Add a custom registry
54 test [-i, --info] Test the response time of all registries
55 del, delete, rm, remove <name...> Remove a custom registry
56 h, -h, help, --help Show this help
57 Examples
58
59 $ mnrm add npm https://registry.npmjs.org/
60
61 $ mnrm use npm
62
63 $ mnrm use taobao output-line get-user-ip body-data simple-unique -S
64
65 $ mnrm list
66
67 * npm --------- https://registry.npmjs.org/
68 yarn -------- https://registry.yarnpkg.com/
69 taobao ------ https://registry.npmmirror.com/
70 tencent ----- https://mirrors.cloud.tencent.com/npm/
71 npmMirror --- https://skimdb.npmjs.com/registry/
72
73 $ mnrm test
74
75 * npm --------- 153 ms
76 yarn -------- 175 ms
77 taobao ------ 519 ms
78 tencent ----- 121 ms
79 npmMirror --- 481 ms
80
81```
82
83## JavaScript API
84
85```js
86import mnrm from 'mini-nrm'
87
88console.log(mnrm.list())
89// output
90// * npm --------- https://registry.npmjs.org/
91// yarn -------- https://registry.yarnpkg.com/
92// taobao ------ https://registry.npmmirror.com/
93// tencent ----- https://mirrors.cloud.tencent.com/npm/
94// npmMirror --- https://skimdb.npmjs.com/registry/
95// github ------ https://npm.pkg.github.com/
96```