@@ -55,24 +55,29 @@ The first has the simplest API and "just works", the second gets you all the bel
5555
5656A [ command-line tool] ( https://eemeli.org/yaml/#command-line-tool ) is also included.
5757
58+ ### Parse & Stringify
59+
5860``` js
5961import { parse , stringify } from ' yaml'
60- // or
61- import YAML from ' yaml'
62- // or
63- const YAML = require (' yaml' )
6462```
6563
66- ### Parse & Stringify
67-
6864- [ ` parse(str, reviver?, options?): value ` ] ( https://eemeli.org/yaml/#yaml-parse )
6965- [ ` stringify(value, replacer?, options?): string ` ] ( https://eemeli.org/yaml/#yaml-stringify )
7066
7167### Documents
7268
69+ <!-- prettier-ignore -->
70+ ``` js
71+ import {
72+ Document ,
73+ isDocument ,
74+ parseAllDocuments ,
75+ parseDocument
76+ } from ' yaml'
77+ ```
78+
7379- [ ` Document ` ] ( https://eemeli.org/yaml/#documents )
7480 - [ ` constructor(value, replacer?, options?) ` ] ( https://eemeli.org/yaml/#creating-documents )
75- - [ ` #anchors ` ] ( https://eemeli.org/yaml/#working-with-anchors )
7681 - [ ` #contents ` ] ( https://eemeli.org/yaml/#content-nodes )
7782 - [ ` #directives ` ] ( https://eemeli.org/yaml/#stream-directives )
7883 - [ ` #errors ` ] ( https://eemeli.org/yaml/#errors )
@@ -83,6 +88,15 @@ const YAML = require('yaml')
8388
8489### Content Nodes
8590
91+ <!-- prettier-ignore -->
92+ ``` js
93+ import {
94+ isAlias , isCollection , isMap , isNode ,
95+ isPair , isScalar , isSeq , Scalar ,
96+ visit , visitAsync , YAMLMap , YAMLSeq
97+ } from ' yaml'
98+ ```
99+
86100- [ ` isAlias(foo): boolean ` ] ( https://eemeli.org/yaml/#identifying-node-types )
87101- [ ` isCollection(foo): boolean ` ] ( https://eemeli.org/yaml/#identifying-node-types )
88102- [ ` isMap(foo): boolean ` ] ( https://eemeli.org/yaml/#identifying-node-types )
@@ -93,13 +107,18 @@ const YAML = require('yaml')
93107- [ ` new Scalar(value) ` ] ( https://eemeli.org/yaml/#scalar-values )
94108- [ ` new YAMLMap() ` ] ( https://eemeli.org/yaml/#collections )
95109- [ ` new YAMLSeq() ` ] ( https://eemeli.org/yaml/#collections )
96- - [ ` doc.createAlias(node, name?): Alias ` ] ( https://eemeli.org/yaml/#working-with-anchors )
110+ - [ ` doc.createAlias(node, name?): Alias ` ] ( https://eemeli.org/yaml/#creating-nodes )
97111- [ ` doc.createNode(value, options?): Node ` ] ( https://eemeli.org/yaml/#creating-nodes )
98112- [ ` doc.createPair(key, value): Pair ` ] ( https://eemeli.org/yaml/#creating-nodes )
99113- [ ` visit(node, visitor) ` ] ( https://eemeli.org/yaml/#finding-and-modifying-nodes )
114+ - [ ` visitAsync(node, visitor) ` ] ( https://eemeli.org/yaml/#finding-and-modifying-nodes )
100115
101116### Parsing YAML
102117
118+ ``` js
119+ import { Composer , Lexer , Parser } from ' yaml'
120+ ```
121+
103122- [ ` new Lexer().lex(src) ` ] ( https://eemeli.org/yaml/#lexer )
104123- [ ` new Parser(onNewLine?).parse(src) ` ] ( https://eemeli.org/yaml/#parser )
105124- [ ` new Composer(options?).compose(tokens) ` ] ( https://eemeli.org/yaml/#composer )
0 commit comments