UNPKG

6.21 kBJSONView Raw
1{
2 "name": "nnrm",
3 "version": "0.3.6",
4 "type": "module",
5 "description": "New npm registry manager.",
6 "main": "index.js",
7 "bin": {
8 "nnrm": "index.js",
9 "nrm": "index.js",
10 "nyrm": "yrm.js",
11 "yrm": "yrm.js",
12 "prm": "prm.js"
13 },
14 "engines": {
15 "node": ">=12.x"
16 },
17 "files": [
18 "index.js",
19 "yrm.js",
20 "prm.js",
21 "utils",
22 "registries.json"
23 ],
24 "keywords": [
25 "npm",
26 "registry",
27 "toggle",
28 "manager"
29 ],
30 "repository": "https://github.com/YunYouJun/nnrm",
31 "author": {
32 "email": "me@yunyoujun.cn",
33 "name": "YunYouJun",
34 "url": "https://www.yunyoujun.cn"
35 },
36 "license": "MIT",
37 "dependencies": {
38 "cac": "^6.7.12",
39 "chalk": "^5.0.1",
40 "execa": "^6.1.0",
41 "node-fetch": "^3.2.3"
42 },
43 "devDependencies": {
44 "c8": "^7.11.2",
45 "vitest": "^0.10.0"
46 },
47 "scripts": {
48 "coverage": "vitest run --coverage",
49 "dev": "node index.js",
50 "ls": "node index.js ls",
51 "test": "npm run ls && npm run test:add && npm run test:remove && npm run test:test",
52 "test:add": "node index.js add yyj https://www.yunyoujun.cn",
53 "test:remove": "node index.js remove yyj",
54 "test:test": "node index.js test",
55 "test:use": "node index.js use taobao",
56 "vitest": "vitest",
57 "postinstall": "node index.js ls"
58 },
59 "readme": "# nnrm\n\nEnglish Docs | [中文文档](./README.zh-CN.md)\n\n[![npm](https://img.shields.io/npm/v/nnrm)](https://www.npmjs.com/package/nnrm)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/yunyoujun/nnrm)\n[![node-current](https://img.shields.io/node/v/nnrm)](https://nodejs.dev/)\n![npm](https://img.shields.io/npm/dt/nnrm)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/nnrm)\n![Snyk Vulnerabilities for npm scoped package](https://img.shields.io/snyk/vulnerabilities/npm/nnrm)\n\n> nnrm = new nrm\n\nNew npm registry manager.\n\nUse smaller dependencies than [nrm](https://github.com/Pana/nrm).\n\n> [由来](https://www.yunyoujun.cn/posts/nnrm-new-nrm/)\n\n## Install\n\n```sh\n# install\nnpm install -g nnrm\nyarn global add nnrm\npnpm add -g nnrm\n```\n\n## Usage\n\nThese commands are used to toggle the corresponding registry.\n\n- `nnrm` & `nrm`: npm\n- `nyrm` & `yrm`: yarn\n- `prm`: pnpm\n\n```sh\nnnrm ls\n# nrm ls\n# yrm ls\n# prm ls\n\nnnrm use taobao\n# nrm use taobao\n# yrm use taobao\n# prm use taobao\n\n# set `.npmrc` for local\nnrm use taobao -l\n\nnnrm test\n# nrm test\n# yrm test\n# prm test\n```\n\n- `nnrm -h`: show help message\n\n```bash\nUsage:\n $ nrm <command> [options]\n\nCommands:\n ls List all the registries\n use [registry] Change registry\n test Show response time for all registries\n add <registry> <url> [home] Add a custom registry\n remove <registry> Remove a custom registry\n\nOptions:\n -h, --help Display this message\n -v, --version Display version number\n```\n\n```bash\nUsage:\n $ nrm use [registry]\n\nOptions:\n -l, --local set '.npmrc' for local\n```\n\n### Add/Remove custom registry\n\n```bash\nnnrm add example https://xxx.com\n```\n\n```bash\nnnrm remove example\n```\n\nIt will be recorded in your `~/.nnrm/registries.json`.\n\n### Default Registires\n\n- npm -------- <https://registry.npmjs.org/>\n- yarn ------- <https://registry.yarnpkg.com/>\n- taobao ----- <https://registry.npmmirror.com/> (taobao redirect `npm.taobao.org` to `npmmirror.com`)\n- tencent ---- <https://mirrors.cloud.tencent.com/npm/>\n- npmMirror -- <https://skimdb.npmjs.com/registry/>\n- github ----- <https://npm.pkg.github.com/>\n\n## Features\n\n- Support `npm`/`yarn`/`pnpm` (the registry of `yarn` and `npm/pnpm` is independent of each other)\n- Smaller Dependencies\n - Use `node-fetch` instead of `request` for speed test\n - Use `execa` instead of `npm`\n - Use `cac` instead of `commander`\n- Asynchronously display source speed test results\n- Colorful console info\n- Automatically display the registry list after each modification, and mark the current registry\n\n## FAQ\n\n### Why new nrm?\n\nnrm relies on the deprecated `request` with a larger package body, the `npm` package, and some other npm dependencies.\n\nSo installing nrm is also a very slow thing.\n\n### Why cac?\n\n> [minimist vs commander vs cac | npm trends](https://www.npmtrends.com/minimist-vs-commander-vs-cac)\n\n[minimist](https://github.com/substack/minimist) is only 1.3 KB, but it is just a parameter parsing tool.\n\nWe need a tool that can automatically generate help information.\n\n[commander](https://github.com/tj/commander.js) and [cac](https://github.com/cacjs/cac) can do it.\n\ncac(3.6KB) is smaller than commander(6.8KB). ~~And i love C.C.~~\n\n### Why node-fetch?\n\n> [node-fetch vs axios vs request](https://www.npmtrends.com/node-fetch-vs-axios-vs-request)\n\n[node-fetch](https://github.com/node-fetch/node-fetch) is only 289B!\n\n[axios](https://github.com/axios/axios)(4.6KB) is good, but node-fetch is smaller.\n\n[request](https://github.com/request/request)(184.8KB) has been deprecated and it is so big.\n\n### Why [execa](https://github.com/sindresorhus/execa)?\n\n> [execa vs shelljs](https://www.npmtrends.com/execa-vs-shelljs)\n\n[execa](https://github.com/sindresorhus/execa) is only 8.4KB.\n\nInstall package [npm](https://www.npmjs.com/package/npm) to use `npm.config.set('registry', 'xxx')` is expensive.\n\nWe just need use local command: `npm config set registry xxx`.\n\n### Error when use Windows?\n\nIf you are a Windows user, you may want to make sure that you use a generic command line like `bash` instead of `CMD`.\n\n### `nrm` conflicts with other commands\n\nnrm(command) is a command of [nrm(package)](https://github.com/Pana/nrm). \nYou should uninstall `nrm(package)` to use `nrm(command)` with `nnrm(package)`. Or you can use `nnrm(command)`.\n\n> 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.\n\n## Ref\n\n- [npm-config | npm Docs](https://docs.npmjs.com/cli/v7/commands/npm-config)\n"
60}
\No newline at end of file