https://github.com/prettier/yaml-unist-parser
A YAML parser that produces output compatible with unist
https://github.com/prettier/yaml-unist-parser
unist yaml
Last synced: 3 months ago
JSON representation
A YAML parser that produces output compatible with unist
- Host: GitHub
- URL: https://github.com/prettier/yaml-unist-parser
- Owner: prettier
- License: mit
- Created: 2018-05-18T14:44:15.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-01-22T17:23:49.000Z (over 1 year ago)
- Last Synced: 2024-10-29T15:15:09.921Z (6 months ago)
- Topics: unist, yaml
- Language: TypeScript
- Homepage:
- Size: 838 KB
- Stars: 25
- Watchers: 6
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# yaml-unist-parser
[](https://www.npmjs.com/package/yaml-unist-parser)
[](https://github.com/prettier/yaml-unist-parser/actions?query=workflow%3ACI+branch%3Amain)
[](https://codecov.io/gh/prettier/yaml-unist-parser)A YAML parser that produces output compatible with [unist](https://github.com/syntax-tree/unist)
[Changelog](https://github.com/ikatyang/yaml-unist-parser/blob/master/CHANGELOG.md)
## Features
- better node positioning
- better comment attaching
- [unist-compatible AST](https://github.com/ikatyang/yaml-unist-parser/blob/master/src/types.ts)## Install
```sh
# using npm
npm install --save yaml-unist-parser# using yarn
yarn add yaml-unist-parser
```## Usage
```ts
import { parse } from "yaml-unist-parser";const ast = parse(`
- hello
- world
`);
```## Development
```sh
# lint
yarn run lint# build
yarn run build# test
yarn run test
```## License
MIT © [Ika](https://github.com/ikatyang)