6

Github GitHub - YunYouJun/nnrm: 🔧 New nrm (NPM registry manager). Use smaller de...

 3 years ago
source link: https://github.com/YunYouJun/nnrm/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

New npm registry manager.

Use smaller dependencies than nrm.

中文简介

Install

# install
yarn global add nnrm
npm install -g nnrm

Usage

nnrm & nrm is used to toggle npm registry.

nyrm & yrm is used to toggle yarn registry.

nnrm ls
# nrm ls
# yrm ls
nnrm use taobao
# nrm use taobao
# yrm use taobao
nnrm test
# nrm test
# yrm test
  • nnrm -h: show help message
Usage:
  $ nrm <command> [options]

Commands:
  ls                           List all the registries
  use [registry]               Change registry
  test                         Show response time for all registries
  add <registry> <url> [home]  Add a custom registry
  remove <registry>            Remove a custom registry

Options:
  -h, --help     Display this message
  -v, --version  Display version number

Add custom registry

nnrm add example https://xxx.com
# nnrm remove example

It will be recorded in your ~/.nnrm/registries.json.

Default Registires

Features

  • 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 info
  • support npm and yarn

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

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 and 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

node-fetch is only 289B!

axios(4.6KB) is good, but node-fetch is smaller.

request(184.8KB) has been deprecated and it is so big.

Why execa?

execa vs shelljs

execa is only 8.4KB.

Install package npm to use npm.config.set('registry', 'xxx') is expensive.

We just need use local command: npm config set registry xxx.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK