toml-to-json Convert TOML to JSON
Examples
Convert a TOML config to JSON
Usage
"title = "My App"
[database]
host = "localhost"
port = 5432" | toml-to-json Convert a Cargo.toml to JSON for tooling
Usage
"[package]
name = "my-crate"
version = "0.1.0"
edition = "202..." | toml-to-json Convert pyproject.toml settings to JSON
Usage
"[tool.poetry]
name = "my-project"
version = "1.0.0"
[tool.p..." | toml-to-json View source
async (input)=>{
try {
const TOML = await import('smol-toml').then(async (m)=>{
await m.__tla;
return m;
});
return JSON.stringify(TOML.parse(input), null, 2);
} catch (e) {
return `Error: ${e.message}`;
}
}