Works with
•JSR Score76%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
Examples
Example 1
Example 1
import { parse, stringify, } from "@std/toml"; const obj = { bin: [ { name: "deno", path: "cli/main.rs" }, { name: "deno_core", path: "src/foo.rs" }, ], nib: [{ name: "node", path: "not_found" }], }; const tomlString = stringify(obj); console.log(tomlString); // => // [[bin]] // name = "deno" // path = "cli/main.rs" // [[bin]] // name = "deno_core" // path = "src/foo.rs" // [[nib]] // name = "node" // path = "not_found" const tomlObject = parse(tomlString); console.log(tomlObject); // => // { // bin: [ // { name: "deno", path: "cli/main.rs" }, // { name: "deno_core", path: "src/foo.rs" } // ], // nib: [ { name: "node", path: "not_found" } ] // }
Functions
Interfaces
I
Formatting Options for stringify
- keyAlignment: boolean
Define if the keys should be aligned or not