json-to-toml Convert JSON to TOML
Examples
Convert a JSON config to TOML format
Usage
"{"title":"My App","database":{"host":"localhost","port":5432..." | json-to-toml Generate a TOML config file from JSON settings
Usage
"{"package":{"name":"my-tool","version":"2.0.0"},"features":{..." | json-to-toml Convert a JSON deployment config to TOML
Usage
"{"server":{"host":"0.0.0.0","port":8080},"database":{"url":"..." | json-to-toml View source
async (input)=>{
try {
const TOML = await import('smol-toml').then(async (m)=>{
await m.__tla;
return m;
});
return TOML.stringify(JSON.parse(input));
} catch (e) {
return `Error: ${e.message}`;
}
}