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




Published2 years ago (0.215.0)
parse and stringify for handling
YAML encoded data.
Ported from js-yaml v3.13.1.
If your YAML contains multiple documents in it, you can use parseAll for
handling it.
To handle regexp, and undefined types, use EXTENDED_SCHEMA.
You can also use custom types by extending schemas.
:warning: Limitations
binarytype is currently not stable.
For further examples see https://github.com/nodeca/js-yaml/tree/master/examples.
Examples
Example 1
Example 1
import { parse, stringify, } from "@std/yaml"; const data = parse(` foo: bar baz: - qux - quux `); console.log(data); // => { foo: "bar", baz: [ "qux", "quux" ] } const yaml = stringify({ foo: "bar", baz: ["qux", "quux"] }); console.log(yaml); // => // foo: bar // baz: // - qux // - quux
Add Package
deno add jsr:@std/yaml
Import symbol
import * as yaml from "@std/yaml";
Import directly with a jsr specifier
import * as yaml from "jsr:@std/yaml";