Skip to content

Commit e43bf4c

Browse files
authored
doc: use precise promise terminology in fs
See #50028 for context - this also has the added benefit of reducing the amount of times we use resolving a promise vs resolving a path. Note this document already used `fulfills` in many cases and I kept resolves (for promises) in some cases where it made sense to me from a technical point of view. PR-URL: #50029 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent d3a5f1f commit e43bf4c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

doc/api/fs.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ added: v10.0.0
673673
* Returns: {Promise}
674674
675675
Change the file system timestamps of the object referenced by the {FileHandle}
676-
then resolves the promise with no arguments upon success.
676+
then fulfills the promise with no arguments upon success.
677677
678678
#### `filehandle.write(buffer, offset[, length[, position]])`
679679
@@ -699,14 +699,14 @@ changes:
699699
700700
Write `buffer` to the file.
701701
702-
The promise is resolved with an object containing two properties:
702+
The promise is fulfilled with an object containing two properties:
703703
704704
* `bytesWritten` {integer} the number of bytes written
705705
* `buffer` {Buffer|TypedArray|DataView} a reference to the
706706
`buffer` written.
707707
708708
It is unsafe to use `filehandle.write()` multiple times on the same file
709-
without waiting for the promise to be resolved (or rejected). For this
709+
without waiting for the promise to be fulfilled (or rejected). For this
710710
scenario, use [`filehandle.createWriteStream()`][].
711711
712712
On Linux, positional writes do not work when the file is opened in append mode.
@@ -756,13 +756,13 @@ changes:
756756
Write `string` to the file. If `string` is not a string, the promise is
757757
rejected with an error.
758758
759-
The promise is resolved with an object containing two properties:
759+
The promise is fulfilled with an object containing two properties:
760760
761761
* `bytesWritten` {integer} the number of bytes written
762762
* `buffer` {string} a reference to the `string` written.
763763
764764
It is unsafe to use `filehandle.write()` multiple times on the same file
765-
without waiting for the promise to be resolved (or rejected). For this
765+
without waiting for the promise to be fulfilled (or rejected). For this
766766
scenario, use [`filehandle.createWriteStream()`][].
767767
768768
On Linux, positional writes do not work when the file is opened in append mode.
@@ -793,14 +793,14 @@ changes:
793793
794794
Asynchronously writes data to a file, replacing the file if it already exists.
795795
`data` can be a string, a buffer, an {AsyncIterable}, or an {Iterable} object.
796-
The promise is resolved with no arguments upon success.
796+
The promise is fulfilled with no arguments upon success.
797797
798798
If `options` is a string, then it specifies the `encoding`.
799799
800800
The {FileHandle} has to support writing.
801801
802802
It is unsafe to use `filehandle.writeFile()` multiple times on the same file
803-
without waiting for the promise to be resolved (or rejected).
803+
without waiting for the promise to be fulfilled (or rejected).
804804
805805
If one or more `filehandle.write()` calls are made on a file handle and then a
806806
`filehandle.writeFile()` call is made, the data will be written from the
@@ -821,14 +821,14 @@ added: v12.9.0
821821
822822
Write an array of {ArrayBufferView}s to the file.
823823
824-
The promise is resolved with an object containing a two properties:
824+
The promise is fulfilled with an object containing a two properties:
825825
826826
* `bytesWritten` {integer} the number of bytes written
827827
* `buffers` {Buffer\[]|TypedArray\[]|DataView\[]} a reference to the `buffers`
828828
input.
829829
830830
It is unsafe to call `writev()` multiple times on the same file without waiting
831-
for the promise to be resolved (or rejected).
831+
for the promise to be fulfilled (or rejected).
832832
833833
On Linux, positional writes don't work when the file is opened in append mode.
834834
The kernel ignores the position argument and always appends the data to
@@ -864,7 +864,7 @@ or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,
864864
`fs.constants.W_OK | fs.constants.R_OK`). Check [File access constants][] for
865865
possible values of `mode`.
866866
867-
If the accessibility check is successful, the promise is resolved with no
867+
If the accessibility check is successful, the promise is fulfilled with no
868868
value. If any of the accessibility checks fail, the promise is rejected
869869
with an {Error} object. The following example checks if the file
870870
`/etc/passwd` can be read and written by the current process.
@@ -1333,7 +1333,7 @@ object with an `encoding` property specifying the character encoding to use for
13331333
the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
13341334
will be passed as {Buffer} objects.
13351335
1336-
If `options.withFileTypes` is set to `true`, the resolved array will contain
1336+
If `options.withFileTypes` is set to `true`, the returned array will contain
13371337
{fs.Dirent} objects.
13381338
13391339
```mjs
@@ -1447,7 +1447,7 @@ added: v10.0.0
14471447
* Returns: {Promise} Fulfills with the `linkString` upon success.
14481448
14491449
Reads the contents of the symbolic link referred to by `path`. See the POSIX
1450-
readlink(2) documentation for more detail. The promise is resolved with the
1450+
readlink(2) documentation for more detail. The promise is fulfilled with the
14511451
`linkString` upon success.
14521452
14531453
The optional `options` argument can be a string specifying an encoding, or an
@@ -6355,7 +6355,7 @@ added: v12.12.0
63556355
Asynchronously close the directory's underlying resource handle.
63566356
Subsequent reads will result in errors.
63576357

6358-
A promise is returned that will be resolved after the resource has been
6358+
A promise is returned that will be fulfilled after the resource has been
63596359
closed.
63606360

63616361
#### `dir.close(callback)`
@@ -6409,7 +6409,7 @@ added: v12.12.0
64096409
Asynchronously read the next directory entry via readdir(3) as an
64106410
{fs.Dirent}.
64116411

6412-
A promise is returned that will be resolved with an {fs.Dirent}, or `null`
6412+
A promise is returned that will be fulfilled with an {fs.Dirent}, or `null`
64136413
if there are no more directory entries to read.
64146414

64156415
Directory entries returned by this function are in no particular order as

0 commit comments

Comments
 (0)