node/lib/internal
Livia Medeiros 8009cb0a78 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
Backport-PR-URL: https://github.com/nodejs/node/pull/42631
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>
2022-04-07 00:20:46 -05:00
..
assert test: add semicolons for linter update 2021-11-21 16:07:29 +01:00
bootstrap bootstrap: reset process._exit and process.exitCode in pre-execution 2022-04-06 12:25:49 -05:00
child_process
cluster cluster: respect listen backlog set by workers 2022-02-21 00:37:31 -05:00
console bootstrap: make I/O streams work with user-land snapshot 2022-04-06 12:25:48 -05:00
crypto lib: prepare files for no-var lint rule 2022-04-06 12:25:55 -05:00
debugger debugger: correct typo in inspect_repl.js 2022-03-20 17:30:23 -04:00
dns lib: prepare files for no-var lint rule 2022-04-06 12:25:55 -05:00
fs fs: fix write methods param validation and docs 2022-04-07 00:20:46 -05:00
http2 lib: prepare files for no-var lint rule 2022-04-06 12:25:55 -05:00
legacy
main build: add --node-snapshot-main configure option 2022-04-06 12:25:48 -05:00
modules esm: emit experimental warnings in common place 2022-04-06 12:20:12 -05:00
per_context lib: add legacy built-in functions to primordials 2022-03-07 17:23:19 +00:00
perf net,dns: trace tcp connection and dns by perf_hooks 2022-04-06 12:20:12 -05:00
policy esm: support https remotely and http locally under flag 2022-02-21 00:37:31 -05:00
process esm: emit experimental warnings in common place 2022-04-06 12:20:12 -05:00
readline readline: bind keystroke ctrl+6 to redo 2022-02-21 00:36:31 -05:00
repl tools,benchmark,lib,test: enable no-case-declarations lint rule 2022-01-14 16:20:12 +01:00
source_map lib: source maps filter null prefix 2022-04-06 12:25:54 -05:00
streams stream: do cleanup when iterator is destroyed 2022-03-20 23:04:31 -04:00
test
tls tls: use optional chaining to simplify checks 2022-01-14 16:19:49 +01:00
util lib: add comments to empty catch statements 2022-02-07 23:29:52 -05:00
vm
webstreams stream: use .chunk when calling adapters's writev 2022-03-07 17:44:02 +00:00
worker lib: move kEnumerableProperty to internal/util 2022-02-22 11:38:51 -05:00
abort_controller.js lib: move kEnumerableProperty to internal/util 2022-02-22 11:38:51 -05:00
assert.js
async_hooks.js tools: enable no-var ESLint rule for lib 2022-04-06 12:25:55 -05:00
blob.js buffer: improve Blob constructor error message when passing a string 2022-04-06 12:25:55 -05:00
blocklist.js
buffer.js
child_process.js child_process: queue pending messages 2022-01-14 16:19:43 +01:00
cli_table.js
constants.js
dgram.js
dtrace.js
encoding.js lib: move kEnumerableProperty to internal/util 2022-02-22 11:38:51 -05:00
error_serdes.js lib: add comments to empty catch statements 2022-02-07 23:29:52 -05:00
errors.js esm: make extension-less errors in type:module actionable 2022-03-20 23:04:30 -04:00
event_target.js events: set default handler value 2022-02-22 11:38:54 -05:00
fixed_queue.js
freelist.js
freeze_intrinsics.js lib: add legacy built-in functions to primordials 2022-03-07 17:23:19 +00:00
heap_utils.js
histogram.js perf_hooks: multiple fixes for Histogram 2022-01-14 16:19:30 +01:00
http.js http: trace http client by perf_hooks 2022-03-20 23:04:31 -04:00
idna.js
inspector_async_hook.js
js_stream_socket.js tools: enable no-var ESLint rule for lib 2022-04-06 12:25:55 -05:00
linkedlist.js cluster: use linkedlist for round_robin_handle 2021-12-13 17:14:01 -05:00
net.js
options.js bootstrap: refresh options in pre-execution 2022-04-06 12:25:48 -05:00
priority_queue.js
promise_hooks.js v8: multi-tenant promise hook api 2021-11-06 10:59:58 +01:00
querystring.js
readme.md
repl.js
socket_list.js
socketaddress.js
stream_base_commons.js tls: improve handling of shutdown 2021-12-13 17:14:15 -05:00
structured_clone.js lib: throw error in structuedClone when no arguments are passed 2022-02-07 12:33:37 -05:00
timers.js timers: check for nullish instead of falsy in loops 2022-01-24 17:35:59 +00:00
trace_events_async_hooks.js
tty.js tty: support more CI services in getColorDepth 2021-10-23 08:54:02 +02:00
url.js url: preserve null char in WHATWG URL errors 2022-03-20 17:30:24 -04:00
util.js lib: move kEnumerableProperty to internal/util 2022-02-22 11:38:51 -05:00
v8_prof_polyfill.js tools: add console to the list of restricted globals 2022-02-22 11:38:56 -05:00
v8_prof_processor.js lib: refactor to avoid unsafe array iteration 2021-10-03 09:48:07 +00:00
validators.js lib: improve the coverage of the validator 2022-04-06 12:25:51 -05:00
watchdog.js test: add semicolons for linter update 2021-11-21 16:07:29 +01:00
worker.js lib: use validateArray 2021-09-26 11:46:14 +00:00

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.