
Product
Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.
@zenweb/router
Advanced tools
ZenWeb 所使用的路由模块
npm i @zenweb/router
import { Core } from '@zenweb/core';
import router from '@zenweb/router';
const app = new Core();
app.setup(router());
app.start();
// GET: /
app.router.get('/', ctx => {
ctx.body = 'static-index'; // static-index
});
// GET: /param/testval
app.router.get('/param/:name', ctx => {
ctx.body = 'param value: ' + ctx.params.name; // param value: testval
});
// GET: /param/prefix99999suffix
app.router.get('/param/prefix:{name}suffix', ctx => {
ctx.body = 'param value: ' + ctx.params.name; // param value: 99999
});
// GET: /param/with-regex/99999
app.router.get('/param/with-regex/:id(\\d+)', ctx => {
ctx.body = 'param value: ' + ctx.params.id; // param value: 99999
});
// GET: /wildcardany/some/path
app.router.get('/wildcard*', ctx => {
ctx.body = 'wildcard: ' + ctx.params.wildcard; // wildcard: any/some/path
});
// GET: /some/pathsuffix
app.router.get('*suffix', ctx => {
ctx.body = 'wildcard: ' + ctx.params.wildcard; // wildcard: /some/path
});
// GET: /betweenany/valuesuffix
app.router.get('/between*suffix', ctx => {
ctx.body = 'wildcard: ' + ctx.params.wildcard; // wildcard: any/value
});
// GET: /regex/aaa
app.router.get(/^\/regex\/(aaa|bbb)$/i, ctx => {
ctx.body = 'regex: ' + ctx.params.$1; // regex: aaa
});
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 5997 | 0.5997 | - |
| zen-router | 6 | 0.0006 | 1000x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 6442 | 0.6442 | - |
| zen-router | 25 | 0.0025 | 258x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 6400 | 0.64 | - |
| zen-router | 247 | 0.0247 | 26x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 6252 | 0.6252 | - |
| zen-router | 896 | 0.0896 | 7x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 6376 | 0.6376 | - |
| zen-router | 339 | 0.0339 | 19x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 4969 | 0.4969 | - |
| zen-router | 708 | 0.0708 | 7x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 53092 | 5.3092 | - |
| zen-router | 682 | 0.0682 | 78x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 54796 | 5.4796 | - |
| zen-router | 694 | 0.0694 | 79x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 46600 | 4.66 | - |
| zen-router | 618 | 0.0618 | 75x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 55195 | 5.5195 | - |
| zen-router | 1175 | 0.1175 | 47x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 47189 | 4.7189 | - |
| zen-router | 868 | 0.0868 | 54x |
| implement | total | ms/req | faster |
|---|---|---|---|
| koa-router | 46008 | 4.6008 | - |
| zen-router | 1141 | 0.1141 | 40x |
FAQs
Zenweb Router module
We found that @zenweb/router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.