diff --git a/doc/api/fs.md b/doc/api/fs.md index 248fa8d41d0304..b704d87ea94e48 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -618,6 +618,9 @@ exist. `data` can be a string or a {Buffer}. If `options` is a string, then it specifies the `encoding`. +The `mode` option only affects the newly created file. See [`fs.open()`][] +for more details. + The `path` may be specified as a {FileHandle} that has been opened for appending (using `fsPromises.open()`). @@ -1333,6 +1336,9 @@ The `encoding` option is ignored if `data` is a buffer. If `options` is a string, then it specifies the encoding. +The `mode` option only affects the newly created file. See [`fs.open()`][] +for more details. + Any specified {FileHandle} has to support writing. It is unsafe to use `fsPromises.writeFile()` multiple times on the same file @@ -1599,6 +1605,9 @@ changes: Asynchronously append data to a file, creating the file if it does not yet exist. `data` can be a string or a {Buffer}. +The `mode` option only affects the newly created file. See [`fs.open()`][] +for more details. + ```mjs import { appendFile } from 'fs'; @@ -4032,6 +4041,9 @@ a file descriptor. The `encoding` option is ignored if `data` is a buffer. +The `mode` option only affects the newly created file. See [`fs.open()`][] +for more details. + If `data` is a plain object, it must have an own (not inherited) `toString` function property. @@ -4206,6 +4218,9 @@ changes: Synchronously append data to a file, creating the file if it does not yet exist. `data` can be a string or a {Buffer}. +The `mode` option only affects the newly created file. See [`fs.open()`][] +for more details. + ```mjs import { appendFileSync } from 'fs'; @@ -5162,6 +5177,9 @@ Returns `undefined`. If `data` is a plain object, it must have an own (not inherited) `toString` function property. +The `mode` option only affects the newly created file. See [`fs.open()`][] +for more details. + For detailed information, see the documentation of the asynchronous version of this API: [`fs.writeFile()`][].