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 |
||
|---|---|---|
| .. | ||
| assert | ||
| bootstrap | ||
| child_process | ||
| cluster | ||
| console | ||
| crypto | ||
| debugger | ||
| dns | ||
| fs | ||
| http2 | ||
| main | ||
| modules | ||
| per_context | ||
| policy | ||
| process | ||
| readline | ||
| repl | ||
| source_map | ||
| streams | ||
| test | ||
| timers | ||
| util | ||
| vm | ||
| worker | ||
| abort_controller.js | ||
| assert.js | ||
| async_hooks.js | ||
| blob.js | ||
| blocklist.js | ||
| buffer.js | ||
| child_process.js | ||
| cli_table.js | ||
| constants.js | ||
| dgram.js | ||
| dtrace.js | ||
| encoding.js | ||
| error_serdes.js | ||
| errors.js | ||
| event_target.js | ||
| fixed_queue.js | ||
| freelist.js | ||
| freeze_intrinsics.js | ||
| heap_utils.js | ||
| histogram.js | ||
| http.js | ||
| idna.js | ||
| inspector_async_hook.js | ||
| js_stream_socket.js | ||
| linkedlist.js | ||
| net.js | ||
| options.js | ||
| priority_queue.js | ||
| querystring.js | ||
| readme.md | ||
| repl.js | ||
| socket_list.js | ||
| socketaddress.js | ||
| stream_base_commons.js | ||
| timers.js | ||
| tls.js | ||
| trace_events_async_hooks.js | ||
| tty.js | ||
| url.js | ||
| util.js | ||
| v8_prof_polyfill.js | ||
| v8_prof_processor.js | ||
| validators.js | ||
| watchdog.js | ||
| worker.js | ||
Internal Modules
The modules in lib/internal are intended for internal use in Node.js core
only, and are not accessible with require() from user modules. These modules
can be changed at any time. Reliance on these modules outside of core
is not supported in any way.