yaml fully supports reading and writing comments and blank lines in YAML documents.
The library is released under the ISC open source license, and the code is available on GitHub. It has no external dependencies, and is usable in both browser and node environments.
For more information, see the project's documentation site: eemeli.org/yaml
npm install yaml# oryarn add yaml
yaml 0.x and 1.x are rather different implementations. For the earlier
yaml, see tj/js-yaml.
The API provided by
// orconst YAML =
YAML.createNode(value, wrapScalars, tag): Node
YAML.parseAllDocuments(str, options): YAML.Document
YAML.parseDocument(str, options): YAML.Document
YAML// '3.14159\n'YAML// `- true// - false// - maybe// - null// `YAML// `number: 3// plain: string// block: >// two//// lines// `