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

@0xsnx/subbridge

v0.3.0

Published

SubBridge: Clash / Clash.Meta YAML to sing-box node injector — extract nodes, auto group by country, inject into template

Readme

占位符

模板中用这些 JSON 友好的占位符标记注入位置,IDE 语法高亮不受影响:

| 占位符 | 位置 | 展开结果 | | :--- | :--- | :--- | | { "$subbridge": "nodes" } | outbounds 数组 | 所有节点的 outbound 对象 | | { "$subbridge": "country_groups" } | outbounds 数组 | 每个国家的 selector + urltest 对象组 | | "$nodes" | 字符串数组 | 所有节点的 tag 列表 | | "$nodes:HK" | 字符串数组 | 香港节点的 tag 列表(支持 23+ 地区代码) |

支持协议:Shadowsocks、VMess、VLESS、Trojan、Hysteria2、HTTP,含 TLS / uTLS / Reality / WebSocket / gRPC。

CLI

# 零配置:使用内置默认模板(TUN 全局代理 + geo 规则 + 国家分组)
subbridge build -i clash.yaml -o config.json

# 远程订阅
subbridge build -i https://example.com/sub -o config.json

# 多源合并
subbridge build -i clash.yaml -i https://example.com/sub -o config.json

# 取得内置模板副本,按需修改后用 -t 覆写
subbridge init -o my-template.json
subbridge build -i clash.yaml -t my-template.json -o config.json

# 本地 Web UI(浏览器粘贴订阅,自动转换)
subbridge serve

安装

npm install -g @0xsnx/subbridge

或从源码安装(需要 Bun 1.3.5+):

git clone https://github.com/zzf2333/SubBridge.git
cd SubBridge
bun install && bun run build && bun run install:local-cli

需要 Node.js 18+ 或 Bun 1.3.5+。

内置默认模板

不传 -t 时工具使用内置默认模板,特点:

| 配置项 | 内容 | | :--- | :--- | | 入站 | TUN 全局代理,支持 IPv4/IPv6 | | DNS | 国内域名 → 223.5.5.5;其余 → 8.8.8.8 走代理 | | 路由规则 | 广告 → block;国内域名/IP → direct;其余 → 代理 | | rule_set 来源 | MetaCubeX/meta-rules-dat(GitHub,可替换为镜像) | | 国家分组 | 自动展开(有节点的国家各生成一个 selector + urltest) |

运行 subbridge init -o my-template.json 可取得副本,自由修改每一行。

文档

License

MIT