@@ -46,7 +46,7 @@ When this plugin is used outside of a supported CIs, it doesn’t do anything.
46
46
## Install
47
47
48
48
This package is [ ESM only] [ esm ] .
49
- In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0 +), install with [ npm] [ ] :
49
+ In Node.js (version 16 +), install with [ npm] [ ] :
50
50
51
51
``` sh
52
52
npm install unified-diff
@@ -79,18 +79,19 @@ This is an an example.
79
79
…and our module ` example.js ` looks as follows:
80
80
81
81
``` js
82
- import {read } from ' to-vfile'
83
- import {reporter } from ' vfile-reporter'
84
- import {unified } from ' unified'
85
- import unifiedDiff from ' unified-diff'
82
+ import process from ' node:process'
86
83
import remarkParse from ' remark-parse'
87
- import remarkStringify from ' remark-stringify'
88
84
import remarkRetext from ' remark-retext'
85
+ import remarkStringify from ' remark-stringify'
89
86
import retextEnglish from ' retext-english'
90
- import retextRepeatedWords from ' retext-repeated-words'
91
87
import retextIndefiniteArticle from ' retext-indefinite-article'
88
+ import retextRepeatedWords from ' retext-repeated-words'
89
+ import {read } from ' to-vfile'
90
+ import {unified } from ' unified'
91
+ import unifiedDiff from ' unified-diff'
92
+ import {reporter } from ' vfile-reporter'
92
93
93
- const file = unified ()
94
+ const file = await unified ()
94
95
.use (remarkParse)
95
96
.use (
96
97
remarkRetext,
@@ -166,7 +167,7 @@ an error, but it’s unrelated to the PR.
166
167
## API
167
168
168
169
This package exports no identifiers.
169
- The default export is ` unifiedDiff ` .
170
+ The default export is [ ` unifiedDiff ` ] [ api-unified-diff ] .
170
171
171
172
### ` unified().use(unifiedDiff) `
172
173
@@ -184,17 +185,24 @@ nothing.
184
185
185
186
PRs welcome!
186
187
188
+ ###### Returns
189
+
190
+ Transform ([ ` Transformer ` ] [ transformer ] ).
191
+
187
192
## Types
188
193
189
194
This package is fully typed with [ TypeScript] [ ] .
190
- There are no additional exported types.
195
+ It exports no additional types.
191
196
192
197
## Compatibility
193
198
194
- Projects maintained by the unified collective are compatible with all maintained
199
+ Projects maintained by the unified collective are compatible with maintained
195
200
versions of Node.js.
196
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
197
- Our projects sometimes work with older versions, but this is not guaranteed.
201
+
202
+ When we cut a new major release, we drop support for unmaintained versions of
203
+ Node.
204
+ This means we try to keep the current release line, ` unified-diff@^4 ` ,
205
+ compatible with Node.js 12.
198
206
199
207
## Contribute
200
208
@@ -255,3 +263,7 @@ abide by its terms.
255
263
[ author ] : https://wooorm.com
256
264
257
265
[ unified ] : https://github.com/unifiedjs/unified
266
+
267
+ [ transformer ] : https://github.com/unifiedjs/unified?tab=readme-ov-file#transformer
268
+
269
+ [ api-unified-diff ] : #unifieduseunifieddiff
0 commit comments