npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

deno-nrm

v0.6.7

Published

deno 实现的 nrm,每次切换源都在 100ms 内,速度超级快

Downloads

9

Readme

README 🦉

简体中文 | English

Bench

npm 镜像源工具速度对比

Usage

install

1. 模块安装

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

如果你装了 node,却没有安装过 deno 👇

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

在一些不想装 deno 的临时场景下 👇

# 注意: 这种使用方式仍然很慢,因为加载 deno 垫片需要时间
npm i deno-nrm -g

2. 本地安装

  1. 下载该项目到本地

  2. 在项目根目录下执行命令

deno task install

cli

# 查看当前源
dnrm

# 切换 taobao 源
dnrm use taobao

# 查看所有源
dnrm ls

# 测试所有源
dnrm test

# 设置源在本地
dnrm use taobao --local

# 查看帮助
dnrm -h

# 查看版本号
dnrm -V

优化原理

  1. 热路径查询
  2. deno 的冷启动比 node 更快
  3. 自动区分使用场景,按需解析参数,按需加载低频模块,按需设置配置文件
  4. 针对 registry 配置使用正则快速获取和替换配置,不使用任何耗时的解析器,不需要序列化和反序列化
  5. 直接针对配置文件进行配置替换,而不是调用子进程执行 npm config set registry=...,因为 npm 内部分支太多,这是卡的主要原因

License

Made with markthree

Published under MIT License.