Skip to content

Commit 432836f

Browse files
committed
Refactor docs
1 parent 40871fe commit 432836f

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

readme.md

+25-22
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ does the same but on [hast][].
4949
## Install
5050

5151
This package is [ESM only][esm].
52-
In Node.js (version 14.14+ and or 16.0+), install with [npm][]:
52+
In Node.js (version 16+), install with [npm][]:
5353

5454
```sh
5555
npm install mdast-util-find-and-replace
@@ -72,9 +72,9 @@ In browsers with [`esm.sh`][esmsh]:
7272
## Use
7373

7474
```js
75+
import {findAndReplace} from 'mdast-util-find-and-replace'
7576
import {u} from 'unist-builder'
7677
import {inspect} from 'unist-util-inspect'
77-
import {findAndReplace} from 'mdast-util-find-and-replace'
7878

7979
const tree = u('paragraph', [
8080
u('text', 'Some '),
@@ -119,7 +119,7 @@ paragraph[8]
119119

120120
## API
121121

122-
This package exports the identifier [`findAndReplace`][api-findandreplace].
122+
This package exports the identifier [`findAndReplace`][api-find-and-replace].
123123
There is no default export.
124124

125125
### `findAndReplace(tree, list[, options])`
@@ -134,8 +134,8 @@ Partial matches are not supported.
134134

135135
* `tree` ([`Node`][node])
136136
— tree to change
137-
* `list` ([`FindAndReplaceList`][api-findandreplacelist] or
138-
[`FindAndReplaceTuple`][api-findandreplacetuple])
137+
* `list` ([`FindAndReplaceList`][api-find-and-replace-list] or
138+
[`FindAndReplaceTuple`][api-find-and-replace-tuple])
139139
— one or more find-and-replace pairs
140140
* `options` ([`Options`][api-options])
141141
— configuration
@@ -166,7 +166,7 @@ Several find and replaces, in array form (TypeScript type).
166166
type FindAndReplaceList = Array<FindAndReplaceTuple>
167167
```
168168
169-
See [`FindAndReplaceTuple`][api-findandreplacetuple].
169+
See [`FindAndReplaceTuple`][api-find-and-replace-tuple].
170170
171171
### `FindAndReplaceTuple`
172172
@@ -212,7 +212,7 @@ Thing to replace with (TypeScript type).
212212
type Replace = ReplaceFunction | string
213213
```
214214
215-
See [`ReplaceFunction`][api-replacefunction].
215+
See [`ReplaceFunction`][api-replace-function].
216216
217217
### `ReplaceFunction`
218218
@@ -226,7 +226,7 @@ The parameters are the result of corresponding search expression:
226226
— whole match
227227
* `...capture` (`Array<string>`)
228228
— matches from regex capture groups
229-
* `match` ([`RegExpMatchObject`][api-regexpmatchobject])
229+
* `match` ([`RegExpMatchObject`][api-regexp-match-object])
230230
— info on the match
231231
232232
###### Returns
@@ -242,19 +242,22 @@ Thing to replace with:
242242
243243
This package is fully typed with [TypeScript][].
244244
It exports the additional types [`Find`][api-find],
245-
[`FindAndReplaceList`][api-findandreplacelist],
246-
[`FindAndReplaceTuple`][api-findandreplacetuple],
245+
[`FindAndReplaceList`][api-find-and-replace-list],
246+
[`FindAndReplaceTuple`][api-find-and-replace-tuple],
247247
[`Options`][api-options],
248-
[`RegExpMatchObject`][api-regexpmatchobject],
248+
[`RegExpMatchObject`][api-regexp-match-object],
249249
[`Replace`][api-replace], and
250-
[`ReplaceFunction`][api-replacefunction].
250+
[`ReplaceFunction`][api-replace-function].
251251
252252
## Compatibility
253253
254-
Projects maintained by the unified collective are compatible with all maintained
254+
Projects maintained by the unified collective are compatible with maintained
255255
versions of Node.js.
256-
As of now, that is Node.js 14.14+ and 16.0+.
257-
Our projects sometimes work with older versions, but this is not guaranteed.
256+
257+
When we cut a new major release, we drop support for unmaintained versions of
258+
Node.
259+
This means we try to keep the current release line,
260+
`mdast-util-find-and-replace@^2`, compatible with Node.js 12.
258261
259262
## Security
260263
@@ -298,9 +301,9 @@ abide by its terms.
298301
299302
[downloads]: https://www.npmjs.com/package/mdast-util-find-and-replace
300303
301-
[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-find-and-replace.svg
304+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-find-and-replace
302305
303-
[size]: https://bundlephobia.com/result?p=mdast-util-find-and-replace
306+
[size]: https://bundlejs.com/?q=mdast-util-find-and-replace
304307
305308
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
306309
@@ -348,18 +351,18 @@ abide by its terms.
348351
349352
[hast-util-find-and-replace]: https://github.com/syntax-tree/hast-util-find-and-replace
350353
351-
[api-findandreplace]: #findandreplacetree-list-options
354+
[api-find-and-replace]: #findandreplacetree-list-options
352355
353356
[api-options]: #options
354357
355358
[api-find]: #find
356359
357360
[api-replace]: #replace
358361
359-
[api-replacefunction]: #replacefunction
362+
[api-replace-function]: #replacefunction
360363
361-
[api-findandreplacelist]: #findandreplacelist
364+
[api-find-and-replace-list]: #findandreplacelist
362365
363-
[api-findandreplacetuple]: #findandreplacetuple
366+
[api-find-and-replace-tuple]: #findandreplacetuple
364367
365-
[api-regexpmatchobject]: #regexpmatchobject
368+
[api-regexp-match-object]: #regexpmatchobject

0 commit comments

Comments
 (0)