diff options
| author | Vincent LE GOFF <g_n_s@hotmail.fr> | 2019-04-05 06:23:05 +0200 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-05 00:23:05 -0400 |
| commit | ae9148752ca1ec8dbbfd121dabc44c724bd8f7fd (patch) | |
| tree | d60014d61579bb60c9f05f0118f85ff1c8d12154 /toml/README.md | |
| parent | f8f561135016d23c0bb4ee75b6d6e54eda9daed8 (diff) | |
toml: add Stringify feature (denoland/deno_std#319)
Original: https://github.com/denoland/deno_std/commit/1e589b95532fd3575b81df65a2a99f7004f8ea1b
Diffstat (limited to 'toml/README.md')
| -rw-r--r-- | toml/README.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toml/README.md b/toml/README.md index b19974b2e..f4ae25857 100644 --- a/toml/README.md +++ b/toml/README.md @@ -91,6 +91,8 @@ will output: ## Usage +### Parse + ```ts import { parseFile, parse } from "./parser.ts"; @@ -99,3 +101,17 @@ const tomlObject = parseFile("file.toml"); const tomlString = 'foo.bar = "Deno"'; const tomlObject22 = parse(tomlString); ``` + +### Stringify + +```ts +import { stringify } from "./parser.ts"; +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); +``` |
