1818* [ Use] ( #use )
1919* [ API] ( #api )
2020 * [ ` u(type[, props][, children|value]) ` ] ( #utype-props-childrenvalue )
21+ * [ ` ChildrenOrValue ` ] ( #childrenorvalue )
22+ * [ ` Props ` ] ( #props )
2123* [ Types] ( #types )
2224* [ Compatibility] ( #compatibility )
2325* [ Related] ( #related )
@@ -42,7 +44,7 @@ when creating hast (HTML) or xast (XML) nodes.
4244## Install
4345
4446This package is [ ESM only] [ esm ] .
45- In Node.js (version 12.20+, 14.14+, 16.0+, or 18 .0+), install with [ npm] [ ] :
47+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
4648
4749``` sh
4850npm install unist-builder
@@ -107,7 +109,7 @@ results in the following tree:
107109
108110## API
109111
110- This package exports the identifier ` u ` .
112+ This package exports the identifier [ ` u ` ] [ u ] .
111113There is no default export.
112114
113115### ` u(type[, props][, children|value]) `
@@ -135,16 +137,37 @@ Build a node.
135137
136138Built node ([ ` Node ` ] [ node ] ).
137139
140+ ### ` ChildrenOrValue `
141+
142+ List to use as ` children ` or value to use as ` value ` (TypeScript type).
143+
144+ ###### Type
145+
146+ ``` ts
147+ type ChildrenOrValue = Array <Node > | string
148+ ` ` `
149+
150+ ### ` Props `
151+
152+ Other fields to add to the node (TypeScript type).
153+
154+ ###### Type
155+
156+ ` ` ` ts
157+ export type Props = Record <string , unknown >
158+ ` ` `
159+
138160## Types
139161
140162This package is fully typed with [TypeScript][].
141- It exports the additional types ` Props ` and ` ChildrenOrValue ` .
163+ It exports the additional types [ ` ChildrenOrValue ` ][childrenorvalue] and
164+ [ ` Props ` ][props].
142165
143166## Compatibility
144167
145168Projects maintained by the unified collective are compatible with all maintained
146169versions of Node.js.
147- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
170+ As of now, that is Node.js 14.14+ and 16 .0+.
148171Our projects sometimes work with older versions, but this is not guaranteed.
149172
150173## Related
@@ -229,3 +252,9 @@ abide by its terms.
229252[hastscript]: https://github.com/syntax-tree/hastscript
230253
231254[xastscript]: https://github.com/syntax-tree/xastscript
255+
256+ [u]: #utype-props-childrenvalue
257+
258+ [props]: #props
259+
260+ [childrenorvalue]: #childrenorvalue
0 commit comments