Skip to content

Commit 9d2acbe

Browse files
committed
Add improved docs
1 parent 309ba4b commit 9d2acbe

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

readme.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ But this helps when integrating with the rest of unified and unist.
3838
## Install
3939

4040
This package is [ESM only][esm].
41-
In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install with [npm][]:
41+
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
4242

4343
```sh
4444
npm install unist-util-find-after
@@ -47,14 +47,14 @@ npm install unist-util-find-after
4747
In Deno with [`esm.sh`][esmsh]:
4848

4949
```js
50-
import {findAfter} from "https://esm.sh/unist-util-find-after@4"
50+
import {findAfter} from 'https://esm.sh/unist-util-find-after@4'
5151
```
5252

5353
In browsers with [`esm.sh`][esmsh]:
5454

5555
```html
5656
<script type="module">
57-
import {findAfter} from "https://esm.sh/unist-util-find-after@4?bundle"
57+
import {findAfter} from 'https://esm.sh/unist-util-find-after@4?bundle'
5858
</script>
5959
```
6060

@@ -85,18 +85,28 @@ Yields:
8585

8686
## API
8787

88-
This package exports the identifier `findAfter`.
88+
This package exports the identifier [`findAfter`][api-findafter].
8989
There is no default export.
9090

9191
### `findAfter(parent, node|index[, test])`
9292

93-
Find the first node in `parent` ([`Parent`][parent]) after another `node`
94-
([`Node`][node]) or after an index, that passes `test` (`Test` from
95-
[`unist-util-is`][test]).
93+
Find the first node in `parent` after another `node` or after an index,
94+
that passes `test`.
95+
96+
###### Parameters
97+
98+
* `parent` ([`Node`][node])
99+
— parent node
100+
* `index` (`number`)
101+
— index of child in `parent`
102+
* `child` ([`Node`][node])
103+
— child in `parent`
104+
* `test` ([`Test`][test])
105+
`unist-util-is`-compatible test
96106

97107
###### Returns
98108

99-
Child of `parent` that passes `test`, if found ([`Node?`][node]).
109+
Child of `parent` ([`Node`][node]) or `null`.
100110

101111
## Types
102112

@@ -107,7 +117,7 @@ It exports no additional types (types for the test are in `unist-util-is`).
107117

108118
Projects maintained by the unified collective are compatible with all maintained
109119
versions of Node.js.
110-
As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
120+
As of now, that is Node.js 14.14+ and 16.0+.
111121
Our projects sometimes work with older versions, but this is not guaranteed.
112122

113123
## Related
@@ -202,6 +212,6 @@ abide by its terms.
202212

203213
[node]: https://github.com/syntax-tree/unist#node
204214

205-
[parent]: https://github.com/syntax-tree/unist#parent-1
206-
207215
[test]: https://github.com/syntax-tree/unist-util-is#test
216+
217+
[api-findafter]: #findafterparent-nodeindex-test

0 commit comments

Comments
 (0)