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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dynamic-router-server

v0.0.4

Published

dynamic router server

Downloads

16

Readme

dynamic-router-server

dynamic router server for axe

Axe中的动态路由提供简单的服务器实现。 使用 :

npm install dynamic-router-server -g

# 参数是文件路径, 以存放数据。
dynamic-router-server path/to/save

版本限定

设置版本,如 设置 login => react://login/ ,版本为1.0.0 ,表示从 1.0.0版本(包括)的APP开始,该规则生效。

而如果之后再次设置login的路由, 如 2.0.0版本,我们把login模块做了一份原生实现, 则配置了login => axe://login/ ,版本号限定为2.0.0

所以,对于2.0.0及以上的APP,使用的是axe://login/ , 而对 1.0.0 -> 2.0.0这中间的部分APP, 依旧使用react://login/的规则。

即版本限定,优先使用最新版本的配置。

tag限定

设置tag的目的,是为了更加灵活的进行设置, 表现为 设置了tag的规则,只对满足tag请求下发这条规则。 tag可以用来解决 多版本APP问题,如一个系统支持多个APP (不建议这样做, 最好还是能一个系统对应一个APP。)。

tag最重要的功能在于 之后可以对接 灰度测试或者 AB测试系统。 如在一个版本上,我们同时有多种实现时 , 我们可以通过tag来设定 APP选择具体路由规则。详细示例 :

如一开始我们有路由 login => axe://login/, 之后我们开发了一个react-native版本, 则我们需要验证一下效果,而不是全部替换。 则我们设定规则login => react://login/ , 对该规则设定了一个tag : react-test

对接AB测试, 则业务系统会给每个用户发放tag , 如设定规则 5%的用户来进行这次测试。 所以有两个用户根据AB测试系统下发的tag, A带着 react-test , B带着xxx ,来请求动态路由服务器, 而服务器根据tag的设定不同,使A 使用 login => react://login/ 规则, 而 B使用 login => axe://login/

tag判断时, 前端可以带多个tag, 而规则命中tag的要求是, 配置的tag在用户的标签列表内。

注意事项

系统只有添加和停止两个操作, 没有修改操作, 也没有删除操作。 对于废弃的规则,要及时停止。

对于规则,在一个版本上, 相同tag设定只应该有一个规则。