Skip to content

Commit 622a99e

Browse files
committed
Add improved docs
1 parent 9d59d0f commit 622a99e

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

readme.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* [Install](#install)
1818
* [Use](#use)
1919
* [API](#api)
20-
* [`findAllAfter(parent, node|index[, test])`](#findallafterparent-nodeindex-test)
20+
* [`findAllAfter(parent, child|index[, test])`](#findallafterparent-childindex-test)
2121
* [Types](#types)
2222
* [Compatibility](#compatibility)
2323
* [Related](#related)
@@ -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-all-after
@@ -47,14 +47,14 @@ npm install unist-util-find-all-after
4747
In Deno with [`esm.sh`][esmsh]:
4848

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

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

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

@@ -89,18 +89,28 @@ Yields:
8989

9090
## API
9191

92-
This package exports the identifier `findAllAfter`.
92+
This package exports the identifier [`findAllAfter`][api-findallafter].
9393
There is no default export.
9494

95-
### `findAllAfter(parent, node|index[, test])`
95+
### `findAllAfter(parent, child|index[, test])`
9696

97-
Find the nodes in `parent` ([`Parent`][parent]) after another `node`
98-
([`Node`][node]) or after an index, that pass `test` (`Test` from
99-
[`unist-util-is`][test]).
97+
Find the nodes in `parent` before a `child` or before an index, that pass
98+
`test`.
99+
100+
###### Parameters
101+
102+
* `parent` ([`Node`][node])
103+
— parent node
104+
* `index` (`number`)
105+
— index of child in `parent`
106+
* `child` ([`Node`][node])
107+
— child in `parent`
108+
* `test` ([`Test`][test])
109+
`unist-util-is`-compatible test
100110

101111
###### Returns
102112

103-
Children of `parent` that pass `test` ([`Array<Node>`][node]).
113+
Children of `parent` ([`Array<Node>`][node]).
104114

105115
## Types
106116

@@ -111,7 +121,7 @@ It exports no additional types (types for the test are in `unist-util-is`).
111121

112122
Projects maintained by the unified collective are compatible with all maintained
113123
versions of Node.js.
114-
As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
124+
As of now, that is Node.js 14.14+ and 16.0+.
115125
Our projects sometimes work with older versions, but this is not guaranteed.
116126

117127
## Related
@@ -207,6 +217,6 @@ abide by its terms.
207217

208218
[node]: https://github.com/syntax-tree/unist#node
209219

210-
[parent]: https://github.com/syntax-tree/unist#parent-1
211-
212220
[test]: https://github.com/syntax-tree/unist-util-is#test
221+
222+
[api-findallafter]: #findallafterparent-childindex-test

0 commit comments

Comments
 (0)