Module

std/encoding/yaml.ts

Deno standard library
Go to Latest
import * as mod from "https://deno.land/std@0.180.0/encoding/yaml.ts";

Examples

Example 1

import {
  parse,
  stringify,
} from "https://deno.land/std@0.180.0/yaml/mod.ts";

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

Variables

Extends JS-YAML default schema with additional JavaScript types It is not described in the YAML specification. Functions are no longer supported for security reasons.

Functions

Parses content as single YAML document.

Same as parse(), but understands multi-document sources. Applies iterator to each document if specified, or returns array of documents.

Serializes object as a YAML document.