sing-box-kit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +25 -2
- package/dist/index.d.mts +3974 -0
- package/dist/index.mjs +10036 -0
- package/docs/configuration.md +56 -0
- package/docs/rules.md +81 -0
- package/index.ts +40 -0
- package/package.json +46 -4
- package/schema/README.md +19 -0
- package/schema/sing-box.json +17266 -0
- package/schema/version.json +4 -0
- package/scripts/generate-schema.ts +7 -0
- package/src/compile.ts +273 -0
- package/src/factories.ts +681 -0
- package/src/generated/sing-box.ts +3558 -0
- package/src/resource.ts +185 -0
- package/src/rules.ts +469 -0
- package/src/schema.ts +207 -0
- package/src/settings.ts +247 -0
- package/src/user.ts +22 -0
- package/tsconfig.json +31 -0
- package/vite.config.ts +16 -0
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sing-box Kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build and validate sing-box v1.14.4 configurations in TypeScript.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
Install the package with `bun add sing-box-kit`, then create `config.ts`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { compile, outbound } from "sing-box-kit";
|
|
11
|
+
|
|
12
|
+
const config = compile({ outbounds: [outbound.direct({ tag: "direct" })] });
|
|
13
|
+
console.log(JSON.stringify(config, null, 2));
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Generate JSON with `bun config.ts > config.json`.
|
|
17
|
+
|
|
18
|
+
On Node.js 22.1 or later, save the same example as `config.mjs` and run `node config.mjs > config.json`.
|
|
19
|
+
|
|
20
|
+
To run the example from a source checkout, run `vp install --frozen-lockfile` and use `./index` as the import path.
|
|
21
|
+
|
|
22
|
+
## Documentation
|
|
23
|
+
|
|
24
|
+
- [Configuration reference](docs/configuration.md)
|
|
25
|
+
- [Route and DNS rules](docs/rules.md)
|
|
26
|
+
- [Schema and type generation](schema/README.md)
|