{"id":17784812,"url":"https://github.com/markthree/dnrm","last_synced_at":"2025-04-09T18:16:23.395Z","repository":{"id":160407534,"uuid":"635299073","full_name":"markthree/dnrm","owner":"markthree","description":"deno 实现的 nrm，每次切换源都在 100ms 内，速度超级快 | deno implementation of nrm, each switch source within 100ms, super fast","archived":false,"fork":false,"pushed_at":"2024-10-27T07:18:27.000Z","size":255,"stargazers_count":70,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T18:16:12.577Z","etag":null,"topics":["deno","npm","nrm","registry","ts","ultrafast"],"latest_commit_sha":null,"homepage":"https://deno.land/x/dnrm","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markthree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-02T11:57:55.000Z","updated_at":"2025-03-02T13:18:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a53decc-9db0-4975-bbc5-6a1b5118fe2b","html_url":"https://github.com/markthree/dnrm","commit_stats":null,"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fdnrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fdnrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fdnrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markthree%2Fdnrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markthree","download_url":"https://codeload.github.com/markthree/dnrm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085322,"owners_count":21045139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","npm","nrm","registry","ts","ultrafast"],"created_at":"2024-10-27T08:06:32.258Z","updated_at":"2025-04-09T18:16:23.368Z","avatar_url":"https://github.com/markthree.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg width=\"100%\" height=\"100%\" src=\"./snapshot.gif\" /\u003e\n    \u003ch1\u003ednrm\u003c/h1\u003e\n    \u003cp\u003e\u003ca href=\"https://deno.com/runtime\" target=\"_blank\"\u003edeno\u003c/a\u003e 实现的 nrm，每次切换源都在 100ms 内，速度超级快\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n## README 🦉\n\n简体中文 | [English](./README_EN.md)\n\n\u003cbr /\u003e\n\n## Bench\n\n[npm 镜像源工具速度对比](https://graphy.app/view/1cf14605-7fd1-4a85-bed8-90e2a7e204ae?caption=true)\n\n\u003cbr /\u003e\n\n## Usage\n\n### install\n\n#### 1. 模块安装\n\n```shell\ndeno install --allow-read --allow-sys --allow-write --allow-env --allow-net -rfn dnrm https://deno.land/x/dnrm/mod.ts\n```\n\n如果你装了 [node](https://nodejs.org)，却没有安装过\n[deno](https://deno.com/runtime) 👇\n\n```shell\nnpx deno-npx install --allow-read --allow-write --allow-env --allow-net -rfn dnrm https://deno.land/x/dnrm/mod.ts\n```\n\n在一些不想装 [deno](https://deno.com/runtime) 的临时场景下 👇\n\n```shell\n# 注意: 这种使用方式仍然很慢，因为加载 deno 垫片需要时间\nnpm i deno-nrm -g\n```\n\n#### 2. 本地安装\n\n1. 下载该项目到本地\n\n2. 在项目根目录下执行命令\n\n```shell\ndeno task install\n```\n\n### cli\n\n```shell\n# 查看当前源\ndnrm\n\n# 切换 taobao 源\ndnrm use taobao\n\n# 查看所有源\ndnrm ls\n\n# 测试所有源\ndnrm test\n\n# 设置源在本地\ndnrm use taobao --local\n\n# 查看帮助\ndnrm -h\n\n# 查看版本号\ndnrm -V\n```\n\n\u003cbr /\u003e\n\n## 优化原理\n\n1. 热路径查询\n2. `deno` 的冷启动比 `node` 更快\n3. 自动区分使用场景，按需解析参数，按需加载低频模块，按需设置配置文件\n4. 针对 `registry`\n   配置使用正则快速获取和替换配置，不使用任何耗时的解析器，不需要序列化和反序列化\n5. 直接针对配置文件进行配置替换，而不是调用子进程执行\n   `npm config set registry=...`，因为 `npm` 内部分支太多，这是卡的主要原因\n\n\u003cbr /\u003e\n\n## License\n\nMade with [markthree](https://github.com/markthree)\n\nPublished under [MIT License](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fdnrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkthree%2Fdnrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkthree%2Fdnrm/lists"}