Commit Graph
9023 Commits
Author SHA1 Message Date
Trivikram Kamat d6bbf5799f sqlite: prevent reentrant session.close()
Reject session.close() while generating a changeset or patchset.
Closing the session at that point frees it while SQLite is still
using it, causing a use-after-free.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/65349
Fixes: https://github.com/nodejs/node/issues/65347
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-08-19 06:42:46 +00:00
soreavis 29a083cffb doc: clarify how fs.Dirent file types are determined
The file type of a directory entry returned by fs.readdir() or
fs.opendir() is the type reported by the operating system's directory
listing. Node.js falls back to lstat() only when the reported type is
unknown, and some file systems may report a type that differs from what
lstat() would return. Document this in the fs.Dirent class introduction,
with fs.lstat() as the accurate alternative.

Fixes: https://github.com/nodejs/node/issues/30646
Signed-off-by: Julian Soreavis <julian.soreavis@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64532
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2026-08-18 15:15:47 +00:00
T 0d84f29fa7 doc: clarify copyFile symlink behavior
Signed-off-by: T <cookesan@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/62941
Fixes: https://github.com/nodejs/node/issues/61518
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-18 07:05:14 +00:00
Erik Demaine 16c06b896c doc: document setRawMode write access on Windows
Fixes: https://github.com/nodejs/node/issues/63852
Signed-off-by: Erik Demaine <edemaine@mit.edu>
PR-URL: https://github.com/nodejs/node/pull/63856
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-18 07:05:05 +00:00
Seongeun Lee 5242e13e19 doc: document per-architecture fast FFI argument limits
The prior text covered only two of the seven supported architectures
and conflated x86-64 SysV with the stricter Win64 emitter.

Signed-off-by: leah-1ee <selee3196@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65207
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-08-18 07:04:55 +00:00
Chaseton Collins 205ef76ba3 doc: add missing return types in fs.md
Three entries in the fs documentation described their return
value only in prose, or not at all, so doc-kit could not parse
a return type and fell back to `void`:

* `filehandle[Symbol.asyncDispose]()` and
  `dir[Symbol.asyncDispose]()` both return a promise, matching
  the existing `Returns: {Promise}` annotations on other async
  dispose methods.
* `new fs.Utf8Stream([options])` is a constructor and returns
  an instance of the class.

Verified at runtime and by rendering the page locally with
doc-kit.

Refs: https://github.com/nodejs/doc-kit/issues/953
Signed-off-by: Chxxeton <43923165+Chxxeton@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/65307
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-08-18 07:04:46 +00:00
Yuya Inoue ba8cdc2594 doc: add missing return types in buffer.md
Add return types for Blob methods and legacy Base64 helpers so doc-kit
does not render them as `void`.

Refs: nodejs/doc-kit#953
Signed-off-by: inoway46 <inoueyuya416@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65308
Refs: https://github.com/nodejs/doc-kit/issues/953
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-18 07:04:36 +00:00
Lazizbek Ergashev 46cac5a7c2 doc: add missing added: tags to fs.lchmod
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65283
Fixes: https://github.com/nodejs/node/issues/65280
Refs: https://github.com/nodejs/node-v0.x-archive/issues/853
Refs: https://github.com/nodejs/node/commit/3935adced09cd557a836d00558b52d777b9a20a2
Refs: https://github.com/nodejs/node/pull/18297
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-16 09:40:37 +00:00
avivkeller 86066045ea cli: add No-Op --experimental-repl-await
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64986
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-15 14:20:31 -07:00
Aviv Keller b9afdd0b87 worker: add support for Web Workers
Signed-off-by: Aviv Keller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64894
Fixes: https://github.com/nodejs/node/issues/43583
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-08-15 13:15:47 -07:00
Guilherme Araújo c7b962c222 sqlite: add diagnostic channel
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62241
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-15 19:42:37 +00:00
greenhead 91aaf05a25 doc: fix SQLite changeset constant descriptions
Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65265
Refs: https://www.sqlite.org/session/c_changeset_abort.html
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-15 14:41:37 +00:00
Guilherme Araújo c8996eaec9 sqlite: add stmt persistent flag
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62757
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
2026-08-14 21:57:31 +00:00
Trevor Burnham c4b755ee00 sqlite: reject connection access from authorizer callbacks
SQLite requires that an authorizer callback not modify the connection
that invoked it, and counts sqlite3_prepare_v2() and sqlite3_step() as
modifications. node:sqlite let the callback call prepare(), exec(), the
statement execution methods, and other connection-mutating APIs on the
same DatabaseSync. Track authorizer depth on DatabaseSync with an RAII
guard around the callback and throw ERR_INVALID_STATE from the affected
entry points while it is on the stack. Covering every authorizer
invocation, including the re-prepare that SQLite can run during
sqlite3_step(), exposed a second and distinct hazard: reentering a
statement that is currently being stepped is a use-after-free rather
than a contract violation, since finalizing it frees the virtual machine
under sqlite3_step() and re-running it resets that machine
mid-execution. Any callback SQLite invokes during execution can reach
it, so a user-defined function is enough. Track the statements currently
being stepped and reject reentry into only those, which leaves a
user-defined function free to prepare, run, and finalize its own helper
statements.

Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
Fixes: https://github.com/nodejs/node/issues/63207
Assisted-by: claude:opus-5
PR-URL: https://github.com/nodejs/node/pull/65156
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-14 21:43:35 +00:00
Yagiz Nizipli 967d4af565 zlib: convert classes to modern syntax and eol DEP0184
Convert ZlibBase, Zlib, and the remaining zlib/Brotli stream
constructors to ES6 class syntax. Calling these constructors without
`new` is no longer supported (DEP0184 End-of-Life); use `new` or the
create* factory helpers instead.

This is a semver-major change: code that relied on `zlib.Gzip()`
(without `new`) will now throw TypeError. The createGzip/createDeflate
helpers and all documented `new`-based usage remain unchanged. The
wire behavior and public options are preserved.

Refs: https://github.com/nodejs/node/pull/55718
Refs: https://github.com/nodejs/node/pull/54708
Assisted-by: Grok
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/64849
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-08-14 14:52:07 +00:00
Harjoth Khara 9e23066b8a doc: document http2 header constants
Signed-off-by: harjoth <harjoth.khara@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64548
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-14 03:39:59 +00:00
Adrián Estrada 54bdc2e383 doc: document REPL DEP0185 throws and uncaught-exception behavior
Two doc-only improvements to `doc/api/repl.md`, both filling gaps left
by recent semver-major REPL changes:

1. `repl.REPLServer` is an ES class; calling it without `new` is
   End-of-Life (DEP0185) and throws a native V8 `TypeError`. The
   "Class: REPLServer" section now notes this and links to the DEP0185
   entry in `doc/api/deprecations.md`. No `Stability: 0` banner is
   added because the class itself is not deprecated — only the
   `new`-less invocation is — matching the parallel DEP0184/DEP0195
   "classes without `new`" convention.

2. PR #64034 ("repl: use inspector over vm") removed the old
   "Global uncaught exceptions" subsection because the `domain`-based
   restrictions it documented no longer exist. A new top-level
   `### Error handling` section documents the current model (mirroring
   the `### Error handling` convention in async_hooks/http2/quic),
   anchored to the existing `Uncaught Error: REPL await` example.

Refs: https://github.com/nodejs/node/pull/59495
Refs: https://github.com/nodejs/node/pull/54869
Refs: https://github.com/nodejs/node/pull/54842
Refs: https://github.com/nodejs/node/pull/64034
Signed-off-by: Adrian Estrada <edsadr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64993
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-08-13 17:26:22 +00:00
Edy Silva f46e96fe54 sqlite: expose prepared statement statistics
Signed-off-by: geeksilva97 <edigleyssonsilva@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64541
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-08-13 13:59:56 +00:00
Chemi Atlow a674c5d1a3 test_runner: extend tag filter with boolean expression DSL
Upgrades the experimental tag filter introduced by stage 1 to accept a
boolean expression instead of a literal tag name.

Grammar: `and`/`&&`, `or`/`||`, `not`/`!`, parentheses for grouping,
and `*` wildcards inside identifiers. Standard precedence
(`not > and > or`); binary operators are left-associative. Word forms
require whitespace separation; punctuation forms do not. Untagged
tests evaluate `false` for any include expression and `true` for
`not X`, so excluding tags does not accidentally remove untagged
tests.

The flag and `testTagFilters` option are still repeatable; multiple
expressions still AND together. Malformed expressions fail fast at
the parent process at startup.

Tag value validation tightens to reject whitespace, operator
characters (`& | ! ( ) *`), and the reserved words `and`/`or`/`not`
in any casing - a breaking change relative to the stage 1 ship,
acceptable at Stability 1.0 (Early development).

Signed-off-by: atlowChemi <chemi@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/63054
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2026-08-13 13:26:26 +00:00
James M Snell bfa3e982ec lib,src: improve histogram implementation
Several improvements:

1. In histogram-inl, Add previous locked only this->mutex while
   reading the other's fields unsafely.
2. In histogram.cc, PrepareCB now uses ContainerOf
3. In histogram.cc, BigInt value range is checked
4. In histogram.js, simplified impl and reduced duplication
5. In event_loop_delay.js, use a more consistent constructor

Adds new analytical APIs to Histogram

* histogram.ccdf(value)
* histogram.cdf(value)
* histogram.countAt(value)
* histogram.ksTest(other)
* histogram.kurtosis
* histogram.linearBuckets(stepSize)
* histogram.logBuckets(first, base)
* histogram.percentilesAt(percentiles)
* histogram.shewness

On RecordableHistogram

* histogram.recordCorrected(val, expectedInterval)
* histogram.subtract(other)

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode/Opus
PR-URL: https://github.com/nodejs/node/pull/65024
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-08-12 07:41:57 -07:00
greenhead 356ee0a45e doc: fix broken fs.BigIntStats link in vfs.md
fs.md describes the bigint variant inside the fs.Stats section and has
no separate fs.BigIntStats section to link to.

Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65045
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-12 13:38:41 +00:00
Augustin Mauroy d1f895fb76 doc: update synopsis
Signed-off-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/65171
Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-08-11 19:34:44 +00:00
Trivikram Kamat 7d712ae426 doc: document close() error when in a sqlite callback
Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/65090
Refs: https://github.com/nodejs/node/pull/64743
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
2026-08-11 18:40:25 +00:00
Kamal Rawal 6a6dee3ed0 assert: improve documentation wording
Signed-off-by: Rawal27 <obviouslykamal@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64953
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2026-08-11 05:48:03 +00:00
Trevor Burnham cb9bb66780 sqlite: reject statement-less SQL in prepare()
Apply the same check to DatabaseSync::Prepare() so that statement-less
SQL is rejected at preparation instead of on first use. This matches
SQLite's own oo1 JavaScript API, which throws when the SQL contains no
statements rather than exposing the C API's null statement pointer.

Previously db.prepare('-- comment') returned a StatementSync whose
statement_ was null. Every method on it threw "statement has been
finalized", which was misleading because nothing had been finalized, and
the object was still inserted into statements_. Since IsFinalized() is
true for a null statement, its destructor skipped UntrackStatement() and
left a dangling pointer in the set that a later close() would finalize.

Refs: https://github.com/nodejs/node/pull/65157#discussion_r3742903347
Refs: https://sqlite.org/wasm/doc/trunk/api-oo1.md

Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65157
Fixes: https://github.com/nodejs/node/issues/65149
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-11 03:14:51 +00:00
Abdelrahman Awad d512d2dec9 diagnostics_channel: mark TracingChannel as stable
Promotes the diagnostics_channel.tracingChannel() factory and the
TracingChannel class from experimental to stable.

TracingChannel has been available since v18.19.0 / v19.9.0 with an
unchanged surface and now has broad adoption: fastify, pino, mysql2,
redis, ioredis, mongoose, graphql, h3, srvx, and the Vercel AI SDK
publish TracingChannel events natively, and it is consumed by
OpenTelemetry, Sentry, Datadog, and New Relic. The last behavioral
wart, tracePromise stripping custom thenables (#59936), was resolved
in #61766.

This mirrors the scoping in #45290: BoundedChannel, the bindStore /
runStores store helpers, and the concrete built-in channels stay
experimental.

Signed-off-by: Abdelrahman Awad <abdelrahman.awad@sentry.io>
PR-URL: https://github.com/nodejs/node/pull/64525
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-08-09 20:56:16 -04:00
Kamat, Trivikram b2b7405d26 sqlite: reject deserialize() while in a callback
deserialize() could be called from a user-defined function invoked
during statement execution, tearing down the database connection while
sqlite3_step() was still using it. Reuse the existing callback depth
check to throw ERR_INVALID_STATE instead, matching the guard already
in place for close().

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64796
Refs: https://github.com/nodejs/node/issues/64795
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-08-09 16:26:58 -07:00
Trivikram Kamat bf2f995661 ffi: reuse the callable created per symbol
CreateFunction() ran on every getFunction() call, every getFunctions()
call, and every read of the functions accessor, each time emitting a
trampoline, allocating an FFIFunctionInfo, and on the SharedBuffer path
an ArrayBuffer. lib.functions.foo was therefore a different function on
each read, and calling through the accessor in a loop leaked a page per
iteration until GC: 20000 calls grew RSS by 58 MiB.

Cache the created callable per symbol in function_wrappers_, and
memoize the JS wrapper composed around it. Both entries are weak, so
dropping the last user reference still releases the wrapper and its
trampoline. The JS side stores a WeakRef because V8 can keep a raw
function alive after the wrapper is gone, and a strong value would pin
every wrapper for the lifetime of the library.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5
PR-URL: https://github.com/nodejs/node/pull/64971
Fixes: https://github.com/nodejs/node/issues/64970
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-08-09 16:18:33 -07:00
Adam Mcgrath 11423b1007 crypto: add mgf1Hash for RSA-OAEP
Signed-off-by: Adam Mcgrath <adam.mcgrath@okta.com>
PR-URL: https://github.com/nodejs/node/pull/65073
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-09 19:06:22 -04:00
greenhead d846ffd04f doc: fix broken internal links
Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64901
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-08-09 11:38:10 +00:00
Brian Muenzenmeyer 45ecaaddbe doc: report proper return type on urlPattern.test
Signed-off-by: bmuenzenmeyer <brian.muenzenmeyer@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64831
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-09 08:06:52 +00:00
kyungrae2002 65a02654f7 test,doc: cover and document multi-byte offset/size in randomFill
Signed-off-by: kyungrae <kyungrae2002@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64834
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2026-08-09 08:06:42 +00:00
greenhead 84b76c8555 doc: fix permission documentation examples
Signed-off-by: greenhead <shren0812@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64897
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-09 08:06:32 +00:00
Hallison Pereira MeloandCursor cbe18d813c quic: convert incoming :status header to number
Signed-off-by: Hallison Melo <hallss93@hotmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PR-URL: https://github.com/nodejs/node/pull/63589
Fixes: https://github.com/nodejs/node/issues/63557
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
2026-08-09 01:18:55 +00:00
Guilherme Araújo 114e356521 doc: document sqlite parameter binding
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65089
Refs: https://github.com/nodejs/node/pull/62001
Refs: https://github.com/nodejs/node/pull/62061
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-08 19:20:54 +00:00
Guilherme Araújo 862d994469 doc: finalize statements in sqlite examples
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65088
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-08 17:17:23 +00:00
Issac 2921232ca0 doc: document quic stopSending() and resetStream()
`QuicStream` exposes `stopSending()` and `resetStream()`, but neither
appeared in the QuicStream API reference. Both matter when half-closing
a stream, which protocols such as WebTransport rely on.

Document the two methods and list them in the "Aborting a stream"
summary, which previously covered only `writer.fail()` and
`stream.destroy()`. Unlike those, both send the given code as-is rather
than deriving a wire code from an error.

Fixes: https://github.com/nodejs/node/issues/63680
Signed-off-by: Ji Hoon Kang <ivory.ma9ic@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64888
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-08 15:41:43 +00:00
Trivikram Kamat f538f11faf sqlite: reject non-positive backup rates
Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy
no pages. The backup job then continually reschedules itself and the
returned promise never settles.

Require backup rates to be positive integers to prevent zero-work
backup jobs.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: https://github.com/nodejs/node/pull/64893
Fixes: https://github.com/nodejs/node/issues/64892
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-08-08 07:29:36 +00:00
Sumit Kumar Das 606356c270 doc: clarify sqlite bare parameter default
Signed-off-by: skdas20 <skdas5405@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62009
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-08-08 07:29:13 +00:00
Augustin Mauroy e43bedc4a9 doc: remove usage of util.inherits
Signed-off-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/60817
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-08-07 11:29:48 +02:00
Kirill Saied 985aa07b48 src: expose Windows-only fs open flags
Signed-off-by: Kirill Saied <sayed.kirill@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64775
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-07 05:19:08 +00:00
이혜미 fe7e8ae228 doc: fix grammar in worker_threads.md
Signed-off-by: hyemimi <hyemi7375@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64913
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2026-08-06 21:25:09 +00:00
Kirill Saied d9d4446bec fs: add windowsHandle option to file streams
Fixes: https://github.com/nodejs/node/issues/57288
Signed-off-by: PickBas <sayed.kirill@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63851
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2026-08-06 21:24:40 +00:00
Antoine du Hamel 3d80990afa doc: fix broken link
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65078
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-08-06 13:17:12 +00:00
James M Snell 27d6cfa9b2 net: improve performance of net.BlockList
* fix duplicate address insertion in SocketAddressBlockList
* fix BlockList rule listing order to match apply
* add minor bound check in BlockList
* improve performance of BlockList apply
* eliminating shared_ptr
* check fast api path
* add clear method to BlockList
* general storage improvements to BlockList
* use shared locks for BlockList reads
* add bulk address adding to BlockList
* add BlockList benchmark
* add remove range/subnet to BlockList
* add cidr notation parsing to BlockList
* add additional apis to BlockList
* add private subnet presets to BlockList

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: OpenCode/Opus
PR-URL: https://github.com/nodejs/node/pull/64974
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-08-06 05:50:42 -07:00
Robert NagyandClaude Opus 5 85d475557a buffer: support aligned allocations
Add an optional `alignment` argument to `Buffer.allocUnsafe()` and
`Buffer.allocUnsafeSlow()`, which guarantees that the memory backing the
returned buffer starts at an address that is a multiple of `alignment`.

Some operating system interfaces refuse to work with unaligned memory.
The motivating case is unbuffered ("direct") file I/O: a read or write
on a descriptor opened with `O_DIRECT` fails with `EINVAL` unless the
buffer address is a multiple of the logical block size of the underlying
device. Until now there was no way to obtain such a buffer from JS,
since the address of a backing store can neither be observed nor chosen.
Alignment is also worth having purely for performance, for instance to
keep a hot buffer from straddling one more cache line than its size
requires.

V8 does not allow picking the address of a backing store, so alignment
is instead achieved by over-allocating `alignment - 1` bytes and
positioning the buffer at the first suitably aligned byte within them.
The new `arrayBufferAlignedOffset()` binding computes that offset.

Addresses are not stable across snapshot serialization, so the binding
reports no padding while a snapshot is being built. Otherwise the
snapshot would capture where this particular process happened to
allocate and stop being reproducible. Buffers restored from a snapshot
are consequently not aligned; the pool works around this by recreating
itself in a deserialize callback.

The `Buffer.allocUnsafe()` pool is now aligned to a cache line itself,
which lets pooled allocations satisfy any alignment up to 64 bytes by
padding their offset into the pool rather than allocating separately.

Assisted-by: Claude/Opus 5
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/65003
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-08-06 09:25:51 +00:00
Guilherme Araújo 51c0d94072 sqlite: add StatementSync.prototype.close()
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64232
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-08-05 18:10:35 -07:00
Guilherme Araújo 04c104a725 sqlite: add StatementSync.prototype[Symbol.dispose]()
This extends explicit resource management support to prepared
statements, allowing a StatementSync to be deterministically
finalized via a `using` declaration, mirroring the existing
DatabaseSync and Session dispose methods.

Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64232
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-08-05 18:10:31 -07:00
Filip Skokan 74ca91a5a2 doc: clarify OpenSSL FIPS configuration
Distinguish OpenSSL 3 provider setup from FIPS/property-query state,
document configuration precedence and provider limitations, and retain
the OpenSSL 1.1 and runtime control guidance.

Regenerate the CLI manpage.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64982
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-05 17:33:08 +00:00
Antoine du Hamel 3f2fc8aaef 2026-08-05, Version 26.7.0 (Current)
Notable changes:

crypto:
  * (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) https://github.com/nodejs/node/pull/63949
  * update root certificates to NSS 3.125 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/64746
lib:
  * (SEMVER-MINOR) add perfetto support (Chengzhong Wu) https://github.com/nodejs/node/pull/64565
module:
  * (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) https://github.com/nodejs/node/pull/63928
test_runner:
  * (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) https://github.com/nodejs/node/pull/64830

PR-URL: https://github.com/nodejs/node/pull/65027
2026-08-05 18:21:40 +02:00