Function stringify
- stringify(obj, options?): string
Parameters
- obj: Record<string, unknown>
Source object
Optionaloptions: StringifyOptionsOptions for stringifying.
Returns string
TOML string
Example: Usage
import { stringify } from "@std/toml/stringify";
import { assertEquals } from "@std/assert";
const obj = {
title: "TOML Example",
owner: {
name: "Bob",
bio: "Bob is a cool guy",
}
};
const tomlString = stringify(obj);
assertEquals(tomlString, `title = "TOML Example"\n\n[owner]\nname = "Bob"\nbio = "Bob is a cool guy"\n`);- obj: Record<string, unknown>
Converts an object to a TOML string.