node/doc/api
Livia Medeiros 75302d3dce fs: fix write methods param validation and docs
The FS docs wrongfully indicated support for passing object with an own
`toString` function property to `FileHandle.prototype.appendFile`,
`FileHandle.prototype.writeFile`, `FileHandle.prototype.write`,
`fsPromises.writeFile`, and `fs.writeSync`. This commit fixes that, and
adds some test to ensure the actual behavior is aligned with the docs.
It also fixes a bug that makes the process crash if a non-buffer object
was passed to `FileHandle.prototype.write`.

Refs: https://github.com/nodejs/node/pull/34993
PR-URL: https://github.com/nodejs/node/pull/41677
Refs: https://github.com/nodejs/node/issues/41666
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Backport-PR-URL: https://github.com/nodejs/node/pull/42603
2022-05-01 16:44:20 -05:00
..
addons.md doc: add link to V8 2021-05-08 12:44:39 -04:00
assert.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
async_hooks.md doc: use ASCII order for md refs 2021-09-04 11:45:00 +02:00
buffer.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
child_process.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
cli.md 2022-02-01, Version 14.19.0 'Fermium' (LTS) 2022-01-25 15:21:32 -05:00
cluster.md
console.md doc: fix typo in console.md 2021-05-01 12:25:07 +02:00
corepack.md 2022-02-01, Version 14.19.0 'Fermium' (LTS) 2022-01-25 15:21:32 -05:00
crypto.md doc: change "Version 4 UUID" to "version 4 UUID" 2021-09-04 10:11:48 +02:00
debugger.md doc: update debugger.md description and examples 2021-09-04 15:14:47 +02:00
deprecations.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
dgram.md doc: refactor fs docs structure 2021-09-01 23:15:26 +02:00
diagnostics_channel.md 2022-02-01, Version 14.19.0 'Fermium' (LTS) 2022-01-25 15:21:32 -05:00
dns.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
documentation.md doc,tools: allow stability table to be updated 2021-05-01 12:25:34 +02:00
domain.md doc: change wording in doc/api/domain.md comment 2021-05-01 12:25:33 +02:00
embedding.md src: add maybe versions of EmitExit and EmitBeforeExit 2021-08-31 10:54:53 -04:00
errors.md 2022-02-01, Version 14.19.0 'Fermium' (LTS) 2022-01-25 15:21:32 -05:00
esm.md doc: specify flag needed for JSON and Wasm modules 2022-05-01 16:44:20 -05:00
events.md doc: use ASCII order for md refs 2021-09-04 11:45:00 +02:00
fs.md fs: fix write methods param validation and docs 2022-05-01 16:44:20 -05:00
globals.md doc: fix YAML comment opening tags 2021-09-04 15:14:52 +02:00
http.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
http2.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
https.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
index.md deps: add corepack 2022-01-25 10:48:47 -05:00
inspector.md inspector: mark as stable 2021-09-04 15:14:31 +02:00
intl.md doc: spell out ICU acronym on first occurrence 2021-05-01 12:25:29 +02:00
module.md tools: add support for mjs and cjs JS snippet linting 2021-06-11 09:30:18 +02:00
modules.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
n-api.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
net.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
os.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
packages.md 2022-02-01, Version 14.19.0 'Fermium' (LTS) 2022-01-25 15:21:32 -05:00
path.md doc: minor clarification to pathObject 2021-06-11 09:30:08 +02:00
perf_hooks.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
policy.md policy: canonicalize before resolving specifiers 2021-09-04 15:14:55 +02:00
process.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
punycode.md docs: add references to punycode.md 2021-05-01 12:24:52 +02:00
querystring.md doc: mark querystring api as legacy 2021-06-11 09:30:10 +02:00
readline.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
repl.md repl: document top level await limitation with const/let 2021-06-11 09:30:09 +02:00
report.md src: add loop idle time in diagnostic report 2021-04-06 15:53:39 -04:00
stream.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
string_decoder.md doc: update list styles for remark-parse@9 rendering 2020-12-15 20:15:18 +00:00
synopsis.md
timers.md doc: remove file name from self-reference links 2021-09-04 10:34:33 +02:00
tls.md 2022-01-10, Version 14.18.3 'Fermium' (LTS) 2022-01-09 15:35:33 +00:00
tracing.md
tty.md doc: remove file name from self-reference links 2021-09-04 10:34:33 +02:00
url.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
util.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
v8.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
vm.md doc: move vm.measureMemory() to expected location in doc 2021-09-04 12:31:04 +02:00
wasi.md tools,doc: add support for several flavors of JS code snippets 2021-06-11 09:30:18 +02:00
worker_threads.md 2021-09-28, Version 14.18.0 'Fermium' (LTS) 2021-09-07 16:31:46 +02:00
zlib.md