@@ -49,7 +49,7 @@ does the same but on [hast][].
49
49
## Install
50
50
51
51
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] [ ] :
53
53
54
54
``` sh
55
55
npm install mdast-util-find-and-replace
@@ -72,9 +72,9 @@ In browsers with [`esm.sh`][esmsh]:
72
72
## Use
73
73
74
74
``` js
75
+ import {findAndReplace } from ' mdast-util-find-and-replace'
75
76
import {u } from ' unist-builder'
76
77
import {inspect } from ' unist-util-inspect'
77
- import {findAndReplace } from ' mdast-util-find-and-replace'
78
78
79
79
const tree = u (' paragraph' , [
80
80
u (' text' , ' Some ' ),
@@ -119,7 +119,7 @@ paragraph[8]
119
119
120
120
## API
121
121
122
- This package exports the identifier [ ` findAndReplace ` ] [ api-findandreplace ] .
122
+ This package exports the identifier [ ` findAndReplace ` ] [ api-find-and-replace ] .
123
123
There is no default export.
124
124
125
125
### ` findAndReplace(tree, list[, options]) `
@@ -134,8 +134,8 @@ Partial matches are not supported.
134
134
135
135
* ` tree ` ([ ` Node ` ] [ node ] )
136
136
— 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 ] )
139
139
— one or more find-and-replace pairs
140
140
* ` options ` ([ ` Options ` ] [ api-options ] )
141
141
— configuration
@@ -166,7 +166,7 @@ Several find and replaces, in array form (TypeScript type).
166
166
type FindAndReplaceList = Array <FindAndReplaceTuple >
167
167
` ` `
168
168
169
- See [ ` FindAndReplaceTuple ` ][api-findandreplacetuple ].
169
+ See [ ` FindAndReplaceTuple ` ][api-find-and-replace-tuple ].
170
170
171
171
### ` FindAndReplaceTuple `
172
172
@@ -212,7 +212,7 @@ Thing to replace with (TypeScript type).
212
212
type Replace = ReplaceFunction | string
213
213
` ` `
214
214
215
- See [ ` ReplaceFunction ` ][api-replacefunction ].
215
+ See [ ` ReplaceFunction ` ][api-replace-function ].
216
216
217
217
### ` ReplaceFunction `
218
218
@@ -226,7 +226,7 @@ The parameters are the result of corresponding search expression:
226
226
— whole match
227
227
* ` ...capture ` ( ` Array <string >` )
228
228
— matches from regex capture groups
229
- * ` match ` ([ ` RegExpMatchObject ` ][api-regexpmatchobject ])
229
+ * ` match ` ([ ` RegExpMatchObject ` ][api-regexp-match-object ])
230
230
— info on the match
231
231
232
232
###### Returns
@@ -242,19 +242,22 @@ Thing to replace with:
242
242
243
243
This package is fully typed with [TypeScript][].
244
244
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 ],
247
247
[ ` Options ` ][api-options],
248
- [ ` RegExpMatchObject ` ][api-regexpmatchobject ],
248
+ [ ` RegExpMatchObject ` ][api-regexp-match-object ],
249
249
[ ` Replace ` ][api-replace], and
250
- [ ` ReplaceFunction ` ][api-replacefunction ].
250
+ [ ` ReplaceFunction ` ][api-replace-function ].
251
251
252
252
## Compatibility
253
253
254
- Projects maintained by the unified collective are compatible with all maintained
254
+ Projects maintained by the unified collective are compatible with maintained
255
255
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.
258
261
259
262
## Security
260
263
@@ -298,9 +301,9 @@ abide by its terms.
298
301
299
302
[downloads]: https://www.npmjs.com/package/mdast-util-find-and-replace
300
303
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
302
305
303
- [size]: https://bundlephobia .com/result?p =mdast-util-find-and-replace
306
+ [size]: https://bundlejs .com/?q =mdast-util-find-and-replace
304
307
305
308
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
306
309
@@ -348,18 +351,18 @@ abide by its terms.
348
351
349
352
[hast-util-find-and-replace]: https://github.com/syntax-tree/hast-util-find-and-replace
350
353
351
- [api-findandreplace ]: #findandreplacetree-list-options
354
+ [api-find-and-replace ]: #findandreplacetree-list-options
352
355
353
356
[api-options]: #options
354
357
355
358
[api-find]: #find
356
359
357
360
[api-replace]: #replace
358
361
359
- [api-replacefunction ]: #replacefunction
362
+ [api-replace-function ]: #replacefunction
360
363
361
- [api-findandreplacelist ]: #findandreplacelist
364
+ [api-find-and-replace-list ]: #findandreplacelist
362
365
363
- [api-findandreplacetuple ]: #findandreplacetuple
366
+ [api-find-and-replace-tuple ]: #findandreplacetuple
364
367
365
- [api-regexpmatchobject ]: #regexpmatchobject
368
+ [api-regexp-match-object ]: #regexpmatchobject
0 commit comments