Replacements for yaml-ast-parser
yaml
yaml is an actively maintained YAML parser with support for YAML 1.1 and 1.2, comments, and AST access.
yaml-ast-parser returns a YAMLNode from load. With yaml, use parseDocument and access the root node through document.contents.
Example:
ts
import { load } from 'yaml-ast-parser'
import { parseDocument } from 'yaml'
const ast = load(source)
const document = parseDocument(source)
const ast = document.contents The AST node types differ between the two packages, so code that traverses or modifies nodes will need to use the node APIs provided by yaml.