{"_id":"@0xsnx/subbridge","name":"@0xsnx/subbridge","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@0xsnx/subbridge","version":"0.3.0","description":"SubBridge: Clash / Clash.Meta YAML to sing-box node injector — extract nodes, auto group by country, inject into template","type":"module","bin":{"subbridge":"dist/cli.js"},"scripts":{"dev":"bun run --watch src/web/server.ts","build":"bun build src/cli/index.ts --outfile dist/cli.js --target node && bun build src/web/server.ts --outfile dist/web.js --target bun","smoke":"./scripts/smoke.sh","proxy:smoke":"./scripts/proxy-smoke.sh","seo:check":"bun scripts/seo-check.ts","release:notes":"bun scripts/release-notes.ts","release:check":"./scripts/release-check.sh","start":"bun dist/web.js","prepack":"bun run build","test":"bun test","lint":"eslint src --ext .ts","format":"prettier --write \"src/**/*.ts\"","install:local-cli":"npm install -g ."},"keywords":["clash","clash-meta","sing-box","proxy","subscription-converter","clash-to-sing-box","sing-box-config","node-injector","template","country-group","clash-subscription"],"engines":{"node":">=18.0.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"author":{"name":"zzf2333"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/zzf2333/SubBridge.git"},"homepage":"https://github.com/zzf2333/SubBridge","dependencies":{"@hono/node-server":"^1.13.0","@types/bun":"^1.3.11","ajv":"^8.12.0","commander":"^12.0.0","hono":"^4.0.0","js-yaml":"^4.1.0"},"devDependencies":{"@types/js-yaml":"^4.0.9","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","eslint":"^8.57.0","prettier":"^3.2.5","typescript":"^5.3.3"},"_id":"@0xsnx/subbridge@0.3.0","gitHead":"40112d4e6250463f9e9e3e91de949acaf0be4a9a","bugs":{"url":"https://github.com/zzf2333/SubBridge/issues"},"_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-HiYJVhRMkztwBN/+5bxlZfgJQq1CJp+Xr12nJxHa7RTPdIBulT6NriiBPMMRelapzPTBCplQi7Vkq5kXTvKqKQ==","shasum":"26fc4f00eaafa833854e3ee9201595a5dc792bf8","tarball":"https://registry.npmjs.org/@0xsnx/subbridge/-/subbridge-0.3.0.tgz","fileCount":5,"unpackedSize":1311868,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@0xsnx%2fsubbridge@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCp/QB34vkn4B32jsawtGYV42rs2a11e4AtAEaJuE/wHQIgfXKo2+FSaIHa5pl4dqqRave5Gm7KdJPp4FDVyVx06Rs="}]},"_npmUser":{"name":"0xsnx","email":"zzfzl2022@gmail.com"},"directories":{},"maintainers":[{"name":"0xsnx","email":"zzfzl2022@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/subbridge_0.3.0_1775556532759_0.8798463461361377"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-07T10:08:52.671Z","0.3.0":"2026-04-07T10:08:52.944Z","modified":"2026-04-07T10:08:53.361Z"},"maintainers":[{"name":"0xsnx","email":"zzfzl2022@gmail.com"}],"description":"SubBridge: Clash / Clash.Meta YAML to sing-box node injector — extract nodes, auto group by country, inject into template","homepage":"https://github.com/zzf2333/SubBridge","keywords":["clash","clash-meta","sing-box","proxy","subscription-converter","clash-to-sing-box","sing-box-config","node-injector","template","country-group","clash-subscription"],"repository":{"type":"git","url":"git+https://github.com/zzf2333/SubBridge.git"},"author":{"name":"zzf2333"},"bugs":{"url":"https://github.com/zzf2333/SubBridge/issues"},"license":"MIT","readme":"<div align=\"center\">\n  <h1>SubBridge</h1>\n  <p><b>你的 sing-box 模板，你说了算。把 Clash 订阅的节点注进去，仅此而已。</b></p>\n  <p><sub>Clash / Clash.Meta YAML → sing-box 节点注入器 · Clash 转 sing-box · Clash 订阅转换 · 生成完整可运行的 sing-box 配置</sub></p>\n  <a href=\"https://github.com/zzf2333/SubBridge/stargazers\"><img src=\"https://img.shields.io/github/stars/zzf2333/SubBridge?style=flat-square\" alt=\"Stars\"></a>\n  <a href=\"https://github.com/zzf2333/SubBridge/releases\"><img src=\"https://img.shields.io/github/v/tag/zzf2333/SubBridge?label=version&style=flat-square\" alt=\"Version\"></a>\n  <a href=\"https://www.npmjs.com/package/@0xsnx/subbridge\"><img src=\"https://img.shields.io/npm/v/@0xsnx%2Fsubbridge?style=flat-square&label=npm\" alt=\"npm\"></a>\n  <a href=\"https://www.npmjs.com/package/@0xsnx/subbridge\"><img src=\"https://img.shields.io/npm/dm/@0xsnx%2Fsubbridge?style=flat-square\" alt=\"npm downloads\"></a>\n  <img src=\"https://img.shields.io/badge/node-%3E%3D18-brightgreen?style=flat-square\" alt=\"Node\">\n  <img src=\"https://img.shields.io/badge/bun-%3E%3D1.3.5-f472b6?style=flat-square\" alt=\"Bun\">\n  <a href=\"LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\" alt=\"License\"></a>\n</div>\n\n<br/>\n\n<img src=\"./assets/cli-demo.png\" width=\"760\" />\n\n<br/>\n\n## 占位符\n\n模板中用这些 JSON 友好的占位符标记注入位置，IDE 语法高亮不受影响：\n\n| 占位符 | 位置 | 展开结果 |\n| :--- | :--- | :--- |\n| [`{ \"$subbridge\": \"nodes\" }`](./docs/template-guide.md) | outbounds 数组 | 所有节点的 outbound 对象 |\n| [`{ \"$subbridge\": \"country_groups\" }`](./docs/template-guide.md) | outbounds 数组 | 每个国家的 selector + urltest 对象组 |\n| [`\"$nodes\"`](./docs/template-guide.md) | 字符串数组 | 所有节点的 tag 列表 |\n| [`\"$nodes:HK\"`](./docs/template-guide.md) | 字符串数组 | 香港节点的 tag 列表（支持 23+ 地区代码） |\n\n支持协议：Shadowsocks、VMess、VLESS、Trojan、Hysteria2、HTTP，含 TLS / uTLS / Reality / WebSocket / gRPC。\n\n## CLI\n\n<img src=\"./assets/web-ui.png\" width=\"760\" />\n\n```bash\n# 零配置：使用内置默认模板（TUN 全局代理 + geo 规则 + 国家分组）\nsubbridge build -i clash.yaml -o config.json\n\n# 远程订阅\nsubbridge build -i https://example.com/sub -o config.json\n\n# 多源合并\nsubbridge build -i clash.yaml -i https://example.com/sub -o config.json\n\n# 取得内置模板副本，按需修改后用 -t 覆写\nsubbridge init -o my-template.json\nsubbridge build -i clash.yaml -t my-template.json -o config.json\n\n# 本地 Web UI（浏览器粘贴订阅，自动转换）\nsubbridge serve\n```\n\n## 安装\n\n```bash\nnpm install -g @0xsnx/subbridge\n```\n\n或从源码安装（需要 Bun 1.3.5+）：\n\n```bash\ngit clone https://github.com/zzf2333/SubBridge.git\ncd SubBridge\nbun install && bun run build && bun run install:local-cli\n```\n\n需要 Node.js 18+ 或 Bun 1.3.5+。\n\n## 内置默认模板\n\n不传 `-t` 时工具使用内置默认模板，特点：\n\n| 配置项 | 内容 |\n| :--- | :--- |\n| **入站** | TUN 全局代理，支持 IPv4/IPv6 |\n| **DNS** | 国内域名 → 223.5.5.5；其余 → 8.8.8.8 走代理 |\n| **路由规则** | 广告 → block；国内域名/IP → direct；其余 → 代理 |\n| **rule_set 来源** | MetaCubeX/meta-rules-dat（GitHub，可替换为镜像） |\n| **国家分组** | 自动展开（有节点的国家各生成一个 selector + urltest） |\n\n运行 `subbridge init -o my-template.json` 可取得副本，自由修改每一行。\n\n## 文档\n\n- [Clash / Clash.Meta YAML 转换指南](./docs/how-to-convert-clash-to-sing-box.md)\n- [模板使用指南（占位符语法 + 23 个地区代码）](./docs/template-guide.md)\n- [自动化验证工具](./docs/verification.md)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-1b1c4e7c7d4114ec2a410185c46e518f"}