Skip to main content

@std/yaml@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score52%
Published2 years ago (0.215.0)
function parseAll
parseAll(
content: string,
iterator: CbFunction,
options?: ParseOptions
): void

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 "@std/yaml/parse";

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

iterator: CbFunction
optional
options: ParseOptions

Return Type

parseAll(
content: string,
options?: ParseOptions
): unknown

Parameters

optional
options: ParseOptions

Return Type

unknown

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/yaml

Import symbol

import { parseAll } from "@std/yaml";
or

Import directly with a jsr specifier

import { parseAll } from "jsr:@std/yaml";