Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yunyoujun/nnrm
π§ New nrm (NPM registry manager). Use smaller dependencies.
https://github.com/yunyoujun/nnrm
npm registry
Last synced: 5 days ago
JSON representation
π§ New nrm (NPM registry manager). Use smaller dependencies.
- Host: GitHub
- URL: https://github.com/yunyoujun/nnrm
- Owner: YunYouJun
- License: mit
- Created: 2021-03-02T16:04:34.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T14:10:12.000Z (4 months ago)
- Last Synced: 2024-10-29T15:49:21.735Z (about 2 months ago)
- Topics: npm, registry
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nnrm
- Size: 341 KB
- Stars: 131
- Watchers: 3
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nnrm
English Docs | [δΈζζζ‘£](./README.zh-CN.md)
[![npm](https://img.shields.io/npm/v/nnrm)](https://www.npmjs.com/package/nnrm)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/yunyoujun/nnrm)
[![node-current](https://img.shields.io/node/v/nnrm)](https://nodejs.dev/)
![npm](https://img.shields.io/npm/dt/nnrm)
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/nnrm)> nnrm = new nrm
New npm registry manager.
Use smaller dependencies than [nrm](https://github.com/Pana/nrm).
|nnrm|nrm|
|---|---|
|[![install size](https://packagephobia.com/badge?p=nnrm@latest)](https://packagephobia.com/result?p=nnrm@latest)|[![install size](https://packagephobia.com/badge?p=nrm)](https://packagephobia.com/result?p=nrm)|> [η±ζ₯](https://www.yunyoujun.cn/posts/nnrm-new-nrm/)
## Install
```sh
# install
npm install -g nnrm
yarn global add nnrm
pnpm add -g nnrm
```## Usage
These commands are used to toggle the corresponding registry.
- `nnrm` & `nrm`: npm
- `nyrm` & `yrm`: yarn(v1-v3)
- `prm`: pnpm```sh
nnrm ls
# nrm ls
# yrm ls
# prm lsnnrm use taobao
# nrm use taobao
# yrm use taobao
# prm use taobao# set `.npmrc` for local
nrm use taobao -lnnrm test
# nrm test
# yrm test
# prm test
```- `nnrm -h`: show help message
```bash
Usage:
$ nrm [options]Commands:
ls List all the registries
use [registry] Change registry
test Show response time for all registries
add [home] Add a custom registry
remove Remove a custom registryOptions:
-h, --help Display this message
-v, --version Display version number
``````bash
Usage:
$ nrm use [registry]Options:
-l, --local set '.npmrc' for local
```### Add/Remove custom registry
```bash
nnrm add example https://xxx.com
``````bash
nnrm remove example
```It will be recorded in your `~/.nnrm/registries.json`.
### Default Registires
- npm --------
- yarn -------
- taobao ----- (taobao redirect `npm.taobao.org` to `npmmirror.com`)
- tencent ----
- npmMirror --
- github -----## Features
- Support `npm`/`yarn(v1-v3)`/`pnpm` (the registry of `yarn` and `npm/pnpm` is independent of each other)
- `yarn(v3)` config use `npmRegistryServer` instead of `registry`
- Smaller Dependencies
- Use `node-fetch` instead of `request` for speed test
- Use `execa` instead of `npm`
- Use `cac` instead of `commander`
- Asynchronously display source speed test results
- Colorful console info
- Automatically display the registry list after each modification, and mark the current registry## FAQ
### Why new nrm?
nrm relies on the deprecated `request` with a larger package body, the `npm` package, and some other npm dependencies.
So installing nrm is also a very slow thing.
### Why cac?
> [minimist vs commander vs cac | npm trends](https://www.npmtrends.com/minimist-vs-commander-vs-cac)
[minimist](https://github.com/substack/minimist) is only 1.3 KB, but it is just a parameter parsing tool.
We need a tool that can automatically generate help information.
[commander](https://github.com/tj/commander.js) and [cac](https://github.com/cacjs/cac) can do it.
cac(3.6KB) is smaller than commander(6.8KB). ~~And i love C.C.~~
### Why node-fetch?
> [node-fetch vs axios vs request](https://www.npmtrends.com/node-fetch-vs-axios-vs-request)
[node-fetch](https://github.com/node-fetch/node-fetch) is only 289B!
[axios](https://github.com/axios/axios)(4.6KB) is good, but node-fetch is smaller.
[request](https://github.com/request/request)(184.8KB) has been deprecated and it is so big.
### Why [execa](https://github.com/sindresorhus/execa)?
Lock `execa@8` for Node.JS 16.
> [execa vs shelljs](https://www.npmtrends.com/execa-vs-shelljs)
[execa](https://github.com/sindresorhus/execa) is only 8.4KB.
Install package [npm](https://www.npmjs.com/package/npm) to use `npm.config.set('registry', 'xxx')` is expensive.
We just need use local command: `npm config set registry xxx`.
### Error when use Windows?
If you are a Windows user, you may want to make sure that you use a generic command line like `bash` instead of `CMD`.
### `nrm` conflicts with other commands
nrm(command) is a command of [nrm(package)](https://github.com/Pana/nrm).
You should uninstall `nrm(package)` to use `nrm(command)` with `nnrm(package)`. Or you can use `nnrm(command)`.> nrm(command) may conflict with [nrm](https://github.com/Pana/nrm) or [ni](https://github.com/antfu/ni). You can uninstall them or just use command `nnrm` without uninstalling them.
## Ref
- [npm-config | npm Docs](https://docs.npmjs.com/cli/v7/commands/npm-config)
## [Sponsors](https://sponsors.yunyoujun.cn)