Skip to content

Commit 33f33d1

Browse files
committed
Refactor docs
1 parent 7857853 commit 33f33d1

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

readme.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333

3434
## What is this?
3535

36-
This utility places file paths and the file system first.
36+
This utility puts the file system first.
3737
Where `vfile` itself focusses on file values (the file contents), this instead
38-
focuses on the file system, which is a common case when working with files.
38+
focuses on the file system, which is a common case when working with *actual*
39+
files from Node.js.
3940

4041
## When should I use this?
4142

@@ -45,7 +46,7 @@ Use `vfile` if there might not be a file system.
4546
## Install
4647

4748
This package is [ESM only][esm].
48-
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
49+
In Node.js (version 16+), install with [npm][]:
4950

5051
```sh
5152
npm install to-vfile
@@ -80,29 +81,29 @@ Yields:
8081
8182
```js
8283
VFile {
84+
cwd: '/Users/tilde/Projects/oss/to-vfile',
8385
data: {},
84-
messages: [],
8586
history: [ 'readme.md' ],
86-
cwd: '/Users/tilde/Projects/oss/to-vfile'
87+
messages: []
8788
}
8889
VFile {
90+
cwd: '/Users/tilde/Projects/oss/to-vfile',
8991
data: {},
90-
messages: [],
9192
history: [ '/Users/tilde/Projects/oss/to-vfile/readme.md' ],
92-
cwd: '/Users/tilde/Projects/oss/to-vfile'
93+
messages: []
9394
}
9495
VFile {
96+
cwd: '/Users/tilde/Projects/oss/to-vfile',
9597
data: {},
96-
messages: [],
9798
history: [ '.git/HEAD' ],
98-
cwd: '/Users/tilde/Projects/oss/to-vfile',
99+
messages: [],
99100
value: <Buffer 72 65 66 3a 20 72 65 66 73 2f 68 65 61 64 73 2f 6d 61 69 6e 0a>
100101
}
101102
VFile {
103+
cwd: '/Users/tilde/Projects/oss/to-vfile',
102104
data: {},
103-
messages: [],
104105
history: [ '.git/HEAD' ],
105-
cwd: '/Users/tilde/Projects/oss/to-vfile',
106+
messages: [],
106107
value: 'ref: refs/heads/main\n'
107108
}
108109
```
@@ -213,7 +214,7 @@ Given file or new file ([`VFile`][vfile]).
213214
214215
Encodings supported by the buffer class (TypeScript type).
215216
216-
This is a copy of the types from Node and [`VFile`][vfile].
217+
This is a copy of the types from Node.
217218
218219
###### Type
219220
@@ -254,12 +255,10 @@ URL to file, path to file, options for file, or actual file (TypeScript type).
254255
###### Type
255256
256257
```ts
257-
type Compatible = Buffer | URL | VFileOptions | VFile | string
258+
type Compatible = Uint8Array | URL | VFile | VFileOptions | string
258259
```
259260
260-
<!-- To do: fix link to `VFileOptions` when `VFile` is updated -->
261-
262-
See [`VFileOptions`][vfile] and [`VFile`][vfile].
261+
See [`VFileOptions`][vfile-options] and [`VFile`][vfile].
263262
264263
### `ReadOptions`
265264
@@ -268,7 +267,7 @@ Configuration for `fs.readFile` (TypeScript type).
268267
###### Fields
269268
270269
* `encoding` ([`BufferEncoding`][api-buffer-encoding], optional)
271-
— encoding to read file as, will turn `file.value` into a string if passed
270+
— encoding to read file as, will turn `file.value` into a `string` if passed
272271
* `flag` (`string`, optional)
273272
— file system flags to use
274273
@@ -279,7 +278,7 @@ Configuration for `fs.writeFile` (TypeScript type).
279278
###### Fields
280279
281280
* `encoding` ([`BufferEncoding`][api-buffer-encoding], optional)
282-
— encoding to write file as
281+
— encoding to write file as when `file.value` is a `string`
283282
* `mode` (`number | string`, optional)
284283
— file mode (permission and sticky bits) if the file was newly created
285284
* `flag` (`string`, optional)
@@ -297,10 +296,13 @@ It exports the additional types
297296
298297
## Compatibility
299298
300-
Projects maintained by the unified collective are compatible with all maintained
299+
Projects maintained by the unified collective are compatible with maintained
301300
versions of Node.js.
302-
As of now, that is Node.js 14.14+ and 16.0+.
303-
Our projects sometimes work with older versions, but this is not guaranteed.
301+
302+
When we cut a new major release, we drop support for unmaintained versions of
303+
Node.
304+
This means we try to keep the current release line, `vfile@^7`,
305+
compatible with Node.js 12.
304306
305307
## Contribute
306308
@@ -362,6 +364,8 @@ abide by its terms.
362364
363365
[vfile]: https://github.com/vfile/vfile
364366
367+
[vfile-options]: https://github.com/vfile/vfile#options
368+
365369
[promise]: https://developer.mozilla.org/Web/JavaScript/Reference/Global_Objects/Promise
366370
367371
[api-read]: #readdescription-options-callback

0 commit comments

Comments
 (0)