Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

std/yaml/mod.ts>parseAll

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function parseAll
import { parseAll } from "https://deno.land/std@0.190.0/yaml/mod.ts";

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

Examples

Example 1

import { parseAll } from "https://deno.land/std@0.190.0/yaml/parse.ts";

const data = parseAll(`
---
id: 1
name: Alice
---
id: 2
name: Bob
---
id: 3
name: Eve
`);
console.log(data);
// => [ { id: 1, name: "Alice" }, { id: 2, name: "Bob" }, { id: 3, name: "Eve" } ]

Parameters

content: string
iterator: CbFunction
optional
options: ParseOptions

Parameters

content: string
optional
options: ParseOptions

Returns

unknown