close
Skip to main content

@std/yaml@1.1.1
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score94%
License
MIT
Downloads30,497/wk
Publisheda week ago (1.1.1)

Parsing and serializing of YAML files

type alias StringifyOptions

Options for stringify.

Properties

optional
indent: number = 2

Indentation width to use (in spaces).

When true, adds an indentation level to array elements.

optional
skipInvalid: boolean = false

Do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types.

Specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everywhere.

Each tag may have own set of styles. - "tag" => "style" map.

optional
schema: SchemaType = "default"

Name of the schema to use.

optional
sortKeys: boolean | ((
a: string,
b: string,
depth: number
) => number)
= false

If true, sort keys when dumping YAML in ascending, ASCII character order. If a function, use the function to sort the keys. If a function is specified, the function must return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise.

Set max line width.

If false, don't convert duplicate objects into references.

If false don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1.

If true flow sequences will be condensed, omitting the space between key: value or a, b. Eg. '[a,b]' or {a:{b:c}}. Can be useful when using yaml for pretty URL query params as spaces are %-encoded.

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 { type StringifyOptions } from "@std/yaml";
or

Import directly with a jsr specifier

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