json-pretty-toml
v1.0.5
Published
Convert JSON to flat TOML with max 2-level keys
Readme
json-pretty-toml
Convert JSON to flat TOML with max 2-level keys.
Installation
npm install -g json-pretty-tomlOr use with npx (no installation):
npx json-pretty-toml < input.jsonUsage
json-pretty-toml < input.json > output.tomlRules
- First level →
[Table] - Second level primitive →
key = value - Second level object →
key.sub = { ... }
Example
Input:
{
"gateway": {
"port": 18789,
"auth": { "mode": "token" }
}
}Output:
[gateway]
port = 18789
auth.mode = "token"Requirements
- Node.js >= 23 (native TypeScript support)
Development
bun install
bun testLicense
MIT
