包详细信息

yaml-unist-parser

prettier241.1kMIT2.0.5

A YAML parser that produces output compatible with unist

unist, yaml

自述文件

yaml-unist-parser

npm build coverage

A YAML parser that produces output compatible with unist

Changelog

Features

Install

# using npm
npm install --save yaml-unist-parser

# using yarn
yarn add yaml-unist-parser

Usage

import { parse } from "yaml-unist-parser";

const ast = parse(`
- hello
- world
`);

Development

# lint
yarn run lint

# build
yarn run build

# test
yarn run test

License

MIT © Ika

更新日志

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.0.5 (2025-03-21)

Bug Fixes

2.0.4 (2025-03-21)

2.0.3 (2025-03-20)

Bug Fixes

  • remove postinstall script (da9d58f)

2.0.2 (2025-03-20)

2.0.1 (2022-10-14)

Bug Fixes

2.0.0 (2022-10-14)

⚠ BREAKING CHANGES

  • switch to esm (#288)
  • drop support for Node.js < 14 (#285)

Features

Bug Fixes

  • attach: end comments for the first item in block mapping/sequence (#276) (92568ad)
  • attach: end comments in flow collections (#270) (1346a27)
  • no false positive for document head end marker position (#272) (4da66cb)

  • drop support for Node.js < 14 (#285) (ce6a042)

1.3.1 (2020-09-08)

Bug Fixes

  • attach: end comments for the first item in block mapping/sequence (#276) (92568ad)

1.3.0 (2020-08-01)

Features

  • treat "<<" as normal key but allow duplication (#274) (2fda6ef)

1.2.1 (2020-05-24)

Bug Fixes

  • no false positive for document head end marker position (#272) (4da66cb)

1.2.0 (2020-05-23)

Bug Fixes

  • attach: end comments in flow collections (#270) (1346a27)

Chores

  • deps: update dependency yaml to 1.10.0 (#269) (2cf5008)

1.1.1 (2019-10-09)

Bug Fixes

  • deps: update dependency tslib to 1.10.0 (#227) (6f88029)

1.1.0 (2019-10-08)

Features

  • update yaml to 1.7.1 and move it to dependencies (#225) (df6412b)

1.0.1 (2019-10-08)

Chores

  • yaml@1.2.0+ is not supported in yaml-unist-parser@1.0.x (207589e)

1.0.0 (2018-11-15)

Bug Fixes

Chores

BREAKING CHANGES

  • require yaml@^1.0.2

1.0.0-rc.4 (2018-08-30)

Bug Fixes

  • enable merge (<<) parsing so that multiple << won't be marked as duplicate keys (#74) (7a5b482)

Features

  • transform AST from yaml AST+CST (#82) (2045635)
    • mappingKey and mappingValue are now always presented in mappingItem
    • comments aren't presented in children anymore (moved to *Comments? fields)
    • attach trailingComment on document (... #comment)
    • attach trailingComment on documentHead (--- #comment)
    • comment between blockValue indicator and its value is now placed in indicatorComment

BREAKING CHANGES

  • remove some unnecessary leadingComments/trailingComments fields
  • rename trailingComments with trailingComment as it's only possible to be 0 or 1
  • replace shorthandTag/verbatimTag/nonSpecificTag with tag

1.0.0-rc.3 (2018-07-31)

Bug Fixes

  • attach: end comments in nested mapping (#70) (efc71fa)

1.0.0-rc.2 (2018-07-17)

Bug Fixes

  • attach: no crash at mappingKey with null and comment (#55) (df3face)
  • peerDeps: require yaml@^1.0.0-rc.7 (#61) (6532413)

Features