node/lib/internal
Stephen Belanger 312476cb84
async_hooks: add using scopes to AsyncLocalStorage
Adds support for using scope = storage.withScope(data) to do
the equivalent of a storage.run(data, fn) with using syntax.
This enables avoiding unnecessary closures.

PR-URL: https://github.com/nodejs/node/pull/61674
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-03-31 10:46:04 +02:00
..
assert assert: use a set instead of an array for faster lookup 2026-01-13 10:04:52 -03:00
async_local_storage async_hooks: add using scopes to AsyncLocalStorage 2026-03-31 10:46:04 +02:00
bootstrap stream: add stream/iter Implementation 2026-03-30 17:20:29 +02:00
child_process child_process: treat ipc length header as unsigned uint32 2026-01-20 15:20:59 +01:00
cluster cluster: fix port reuse between cluster 2026-01-20 14:35:57 +01:00
console console: optimize single-string logging 2025-11-05 23:07:51 +01:00
crypto crypto: add TurboSHAKE and KangarooTwelve Web Cryptography algorithms 2026-03-30 17:20:28 +02:00
debugger inspector: unwrap internal/debugger/inspect imports 2026-02-28 12:07:01 +01:00
dns lib: prefer call() over apply() if argument list is not array 2026-01-13 10:04:20 -03:00
encoding lib: use utf8 fast path for streaming TextDecoder 2026-02-02 14:02:22 +01:00
errors
events
fs stream: add stream/iter Implementation 2026-03-30 17:20:29 +02:00
http2 http2: add strictSingleValueFields option to relax header validation 2026-02-22 01:07:47 +01:00
inspector inspector: inspect HTTP response body 2025-11-10 13:38:33 +01:00
legacy
main watch: get flags from execArgv 2026-02-19 11:14:04 +01:00
modules esm: fix typo in worker loader hook comment 2026-03-31 10:46:04 +02:00
per_context perf_hooks: fix stack overflow error 2025-10-13 10:05:45 +02:00
perf perf_hooks: fix stack overflow error 2025-10-13 10:05:45 +02:00
process stream: add stream/iter Implementation 2026-03-30 17:20:29 +02:00
quic quic: remove CryptoKey support from session keys option 2026-03-30 17:20:29 +02:00
readline repl: fix pasting after moving the cursor to the left 2025-11-05 23:09:48 +01:00
repl lib: remove top-level getOptionValue() calls in lib/internal/modules 2026-02-22 01:07:45 +01:00
source_map lib: fix source map url parse in dynamic imports 2026-03-10 14:48:51 +01:00
streams stream: add stream/iter Implementation 2026-03-30 17:20:29 +02:00
test
test_runner test_runner: add exports option for module mocks 2026-03-30 17:20:28 +02:00
tls tls: wrap SNICallback invocation in try/catch 2026-03-20 15:07:12 -03:00
util util: add fast path to stripVTControlCharacters 2026-02-28 12:06:58 +01:00
v8 src: fix timing of snapshot serialize callback 2025-10-28 01:20:14 +01:00
vm lib: prefer call() over apply() if argument list is not array 2026-01-13 10:04:20 -03:00
watch_mode
webstreams stream: optimize webstreams pipeTo 2026-03-10 20:20:07 +01:00
worker lib: replace global SharedArrayBuffer constructor with bound method 2025-11-05 23:07:52 +01:00
abort_controller.js
assert.js
async_context_frame.js
async_hooks.js async_hooks: enabledHooksExist shall return if hooks are enabled 2026-01-20 14:34:30 +01:00
blob.js lib: improve argument handling in Blob constructor 2026-02-28 12:07:22 +01:00
blocklist.js
buffer.js buffer: disallow ArrayBuffer transfer on pooled buffer 2026-01-28 19:35:57 +01:00
child_process.js child_process: add tracing channel for spawn 2026-02-28 12:06:59 +01:00
cli_table.js
constants.js
data_url.js
dgram.js
encoding.js lib: use utf8 fast path for streaming TextDecoder 2026-02-02 14:02:22 +01:00
error_serdes.js
errors.js lib: fix TypeScript support check in jitless mode 2026-01-20 14:36:02 +01:00
event_target.js events: remove redundant todo 2026-01-20 15:21:04 +01:00
file.js lib: prefer call() over apply() if argument list is not array 2026-01-13 10:04:20 -03:00
fixed_queue.js lib: recycle queues 2026-02-02 14:02:21 +01:00
freelist.js
freeze_intrinsics.js
heap_utils.js
histogram.js
http.js http: add http.setGlobalProxyFromEnv() 2026-01-13 10:04:44 -03:00
inspector_async_hook.js async_hooks: add trackPromises option to createHook() 2026-01-28 19:35:56 +01:00
inspector_network_tracking.js
js_stream_socket.js
linkedlist.js
locks.js diagnostics_channel: add diagnostics channels for web locks 2026-03-28 18:14:05 +01:00
mime.js util: optimize toASCIILower function using V8s native toLowerCase 2026-01-13 10:04:54 -03:00
navigator.js
net.js tls: forward keepAlive, keepAliveInitialDelay, noDelay to socket 2026-03-02 14:34:55 +00:00
options.js doc: fix node-config-schema 2026-02-02 14:02:22 +01:00
priority_queue.js
promise_hooks.js
querystring.js
README.md
repl.js
socket_list.js
socketaddress.js lib: enforce use of URLParse 2026-01-13 10:04:48 -03:00
stream_base_commons.js
timers.js
trace_events_async_hooks.js
tty.js
url.js url: add fast path to getPathFromURL decoder 2026-01-13 10:04:56 -03:00
util.js lib: fix TypeScript support check in jitless mode 2026-01-20 14:36:02 +01:00
v8_prof_polyfill.js src: build v8 tick processor as built-in source text modules 2026-01-13 10:04:00 -03:00
validators.js http: validate headers in writeEarlyHints 2026-03-02 14:41:03 +00:00
vm.js lib: prefer call() over apply() if argument list is not array 2026-01-13 10:04:20 -03:00
wasm_web_api.js
watchdog.js
webidl.js
webstorage.js Revert "lib: throw from localStorage getter on missing storage path" 2025-11-16 20:45:44 +01:00
worker.js worker: eliminate race condition in process.cwd() 2026-02-19 11:14:03 +01:00

Internal Modules

The modules located in lib/internal directory are exclusively meant for internal usage within the Node.js core. They are not intended to be accessed via user modules require(). These modules may change at any point in time. Relying on these internal modules outside the core is not supported and can lead to unpredictable behavior.

In certain scenarios, accessing these internal modules for debugging or experimental purposes might be necessary. Node.js provides the --expose-internals flag to expose these modules to userland code. This flag only exists to assist Node.js maintainers with debugging internals. It is not meant for use outside the project.