pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

json-to-toml Convert JSON to TOML

⟐ Data
Input0 chars
Output0 chars

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}`;
                }
            }