Skip to content

Latest commit

 

History

History
102 lines (68 loc) · 2.19 KB

README_EN.md

File metadata and controls

102 lines (68 loc) · 2.19 KB

dnrm

deno implementation of nrm, each switch source within 100ms, super fast


README 🦉

简体中文 | English


Bench

Comparison of npm mirror source tools speed


Usage

install

1. Module Installation

deno install --allow-read --allow-write --allow-env --allow-net -rfn dnrm https://deno.land/x/dnrm/mod.ts

If you have node installed but have not installed deno 👇

npx deno-npx install --allow-read --allow-write --allow-env --allow-net -rfn dnrm https://deno.land/x/dnrm/mod.ts

In some temporary scenarios where you don't want to install deno 👇

# Note: This usage is still slow because it takes time to load the deno shims
npm i deno-nrm -g

2. Local Installation

  1. Download the project locally

  2. Execute the command in the project root directory

deno task install

cli

# View current source
dnrm

# Switch taobao source
dnrm use taobao

# View all sources
dnrm ls

# Test all sources
dnrm test

# Set the source locally
dnrm use taobao --local

# View Help
dnrm -h

# View version
dnrm -V

Optimization Principle

  1. Hot Path Search
  2. deno has a faster cold start than node.
  3. Automatically distinguish usage scenarios, parse parameters on demand, load low-frequency modules on demand, and set profiles on demand
  4. use regular configuration for registry configuration to quickly fetch and replace configuration without any time-consuming parser, no serialization and deserialization
  5. replace the configuration directly against the configuration file instead of calling a child process to do npm config set registry=..., because npm has too many internal branches, which is the main reason for getting stuck

License

Made with markthree

Published under MIT License.