Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Nodejs Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-nodejs-knowledge-patch)
---
name: nodejs-knowledge-patch
description: Node.js
version: "26.13.1"
license: MIT
metadata:
author: Nevaberry
---
# Node.js knowledge patch
Load this skill when updating Node.js application code, launch configuration,
tests, native addons, or source builds. It covers compatibility changes,
API migrations, and new runtime capabilities.
Use the topic references for complete guidance and examples. Their release
attributions distinguish changes in defaults, experimental status, removals,
and restorations.
## Reference index
| Reference | Topics |
| --- | --- |
| [CLI, configuration, SEA, and releases](references/cli-config-sea-and-releases.md) | Startup arguments, JSON configuration, environment files, watch mode, single-executable applications, dependencies, release support |
| [Cryptography and compression](references/crypto-and-compression.md) | Crypto migrations, signatures, key formats, derivation, Web Crypto, FIPS, compression, ZIP |
| [Diagnostics and performance](references/diagnostics-and-performance.md) | Diagnostic channels, tracing, inspector, debugger, profiling, heaps, call sites, logging |
| [Filesystem, buffers, and streams](references/filesystem-and-streams.md) | Filesystem migrations, directories, globs, virtual filesystems, buffers, classic and Web streams, iterable streams |
| [Modules and TypeScript](references/modules-and-typescript.md) | Resolution, synchronous ES module loading, hooks, compile cache, TypeScript, VM modules, WebAssembly, WASI |
| [Native addons and builds](references/native-addons-and-builds.md) | Platform requirements, compilers, ABI, Node-API, embedding, foreign function interface |
| [Networking, HTTP, and TLS](references/networking-http-and-tls.md) | Proxies, trust stores, TLS identity and sessions, HTTP, HTTP/2, HTTP/3, QUIC, DNS, TCP, UDP |
| [Processes, workers, and permissions](references/process-workers-and-permissions.md) | Permission Model, audit and revocation, child processes, workers, async context, process replacement |
| [Runtime and Web platform](references/runtime-and-web-platform.md) | Legacy APIs, events, cancellation, URLs, MIME, Web Storage, Blob, Temporal, terminal utilities |
| [SQLite](references/sqlite.md) | Connection defaults, authorization, statements, binding, tag stores, sessions, functions, backups |
| [Testing and assertions](references/testing-and-assertions.md) | Assertions, mocks, snapshots, discovery, coverage, reporters, isolation, execution context |
## Breaking changes and deprecations
### Startup arguments and configuration
Remove `--no-experimental-fetch`, `--no-experimental-global-webcrypto`,
`--no-experimental-global-customevent`, and `--trace-atomics-wait` from startup
arguments and `NODE_OPTIONS`. Replace the removed `--experimental-permission`
alias with `--permission`.
Remove `--experimental-default-type`; select the package type with
`"type": "module"` or `"type": "commonjs"`, or use `.mjs` and `.cjs`.
Loading `node.config.json` fails on unknown fields. Rename the top-level
`testRunner` key to `test`; a `test` or `permission` namespace enables that mode.
### TypeScript and module loading
Built-in stripping of erasable TypeScript types is stable: run `node app.ts`.
In 26.0.0, `--experimental-transform-types` was removed. Transpile TypeScript
that needs code generation, such as enums, before running it with Node.js.
In 26.0.0, extensionless files in a `"type": "module"` package no longer get a
CommonJS exception. Give files requiring CommonJS semantics a `.cjs` extension.
`module.register()` is documentation-deprecated as `DEP0205` and emits a runtime
warning in 26.0.0. For synchronous hooks, use `module.registerHooks()`.
### Filesystem and buffer migrations
Use `dirent.parentPath` in place of `dirent.path`. `fs.truncate()` and
`fs.truncateSync()` require paths; use `fs.ftruncate(fd, length, callback)` or
`fs.ftruncateSync(fd, length)` for file descriptors.
Use `fs.rm(path, { recursive: true })` for recursive removal and read access
masks from `fs.constants`. Close `FileHandle` instances explicitly with
`await handle.close()`. Explicitly close directories or use their disposal APIs.
Migrate `SlowBuffer` to `Buffer.allocUnsafeSlow(size)`. Use `Buffer.alloc(size)`
when bytes must start at zero.
### HTTP and TLS migrations
Use `response.writeHead()` in place of `writeHeader()`, which was removed in
26.0.0. Migrate `_headers` reads to `message.getHeaders()` and enumerate names
with `message.getHeaderNames()`.
HTTP/2 priority signaling is no longer supported: remove `Http2Stream.priority()`
calls and reliance on request priority options or `priority` events. Remove the
unsupported `selectPadding` session callback.
Replace `tls.createSecurePair()` with `new tls.TLSSocket(socket, options)`.
Pass server options to `tls.createServer(options)` because
`tls.Server.prototype.setOptions()` reached end of life.
### Cryptography migrations
Use `crypto.getFips()` and `crypto.setFips()` in place of `crypto.fips`.
Give SHAKE128 and SHAKE256 an explicit output length. RSA-PSS key generation
uses `hashAlgorithm` and `mgf1HashAlgorithm` in place of `hash` and `mgf1Hash`.
In 26.0.0, GCM deciphers created without `authTagLength` reject short tags.
Set `authTagLength` to the tag size in bytes when creating the decipher.
For cSHAKE digest and KMAC operations, use `outputLength` instead of `length`;
KMAC key generation still uses `length` for the key size.
### Tests, assertions, and child processes
Use `assert.fail(message)` for explicit failures; the multiple-argument overload
and `assert.CallTracker` reached end of life. Distinct weak collections and
promises fail deep comparisons by identity; two invalid dates compare equal.
Pass `exports` to `t.mock.module()` in place of `defaultExport` and `namedExports`.
Its `default` property supplies the default export; other own enumerable
properties supply named exports. The migration command is
`npx codemod @nodejs/mock-module-exports`.
Passing an argument array with `{ shell: true }` to `spawn()` or `execFile()`
triggers `DEP0190`. Use an argument array with a direct launch for untrusted
values. Await `worker.terminate()` for the exit code and use `subprocess.channel`
for the child process IPC channel.
### Stream behavior
In byte mode, `readable.read()` without a size can return one buffered chunk.
Call it repeatedly until it returns `null` to drain available data.
`stream.pipeline()` fails for an already closed or destroyed destination;
use a fresh writable when retrying. A stream error takes precedence when an
`AbortError` also occurs in the pipeline.
`readable.compose()` returns the composed duplex directly; check
`readableObjectMode` when downstream code depended on the implicit wrapper.
`DecompressionStream` rejects trailing junk after compressed data.
## Frequently used capabilities
### Synchronous ES modules and hooks
Synchronous `require()` of ES modules is stable. Use `--no-require-module` to
disable it or `--require-module` to enable it explicitly. Keep the module and
its dependencies free of top-level `await` for synchronous loading.
Check `process.features.require_module`, or put `"module-sync"` before
`"default"` in package exports to serve the same ES module to `import` and
`require()` when supported:
```json
{"exports": {"module-sync": "./index.mjs", "default": "./index.cjs"}}
```
`registerHooks()` runs synchronous `resolve` and `load` hooks in the loading
thread. Its `ModuleHooks` handle supports `using` to deregister hooks at scope
exit. `import.meta.main` identifies the ES module entry point.
### Permission Model
Enable it with `node --permission --allow-fs-read=. app.js`. Network and
inspector access use `--allow-net` and `--allow-inspector`. Entry-point reads
are implicit; grant other required paths with `--allow-fs-read`.
Use `node --permission-audit app.js` to identify needed grants. In audit mode,
an operation can continue after a denied check. With the model enabled,
`process.permission.drop()` revokes grants after the work needing them is done.
For example, `process.permission.drop('addon')` revokes native addon loading.
### Test execution and coverage
Parent tests automatically wait for subtests. Completion promises from
`test()` and `t.test()` were restored in 24.3.0; `await t.test(...)` can order
parent work after a specific subtest.
Use `t.waitFor(fn)` with a throwing assertion to wait for a condition.
`t.mock.property(object, key, value)` restores the original at test end.
`getTestContext()` accesses the active test context from helpers.
Coverage remaps to original source only with `--enable-source-maps`. Include
unexecuted source files with an include glob and `--test-coverage-include-all`:
```sh
node --test --experimental-test-coverage --test-coverage-include-all --test-coverage-include='src/**/*.js'
```
### SQLite connections and statements
`node:sqlite` reaches release candidate status in 24.15.0. `DatabaseSync`
enables foreign keys and disables double-quoted string literals by default.
Use single quotes for SQL strings. Defensive mode defaults to enabled in
25.5.0; use `{ defensive: false }` when a connection needs blocked SQL features.
Use `db.createTagStore()` to cache prepared statements and bind template
substitutions as SQL parameters. Read its `size` property. Finish a query's
iterator before reusing its cached statement. `StatementSync.close()` or
`using` finalizes a statement explicitly.
Use `db.createSession()` and `session.changeset()` to track and export changes;
export needed changesets before closing the database. `backup()` copies an
open database asynchronously and requires a positive `rate` when supplied.
### Proxies, trust, and connections
Use `--use-env-proxy` or `NODE_USE_ENV_PROXY=1` for the default HTTP and HTTPS
agents to honor proxy environment variables. `NODE_USE_ENV_PROXY=1` also enables
proxy configuration for built-in `fetch()`. `setGlobalProxyFromEnv()` applies
proxy configuration to the default agents and `fetch()` at runtime.
`--use-system-ca` or `NODE_USE_SYSTEM_CA=1` adds system trust certificates.
`tls.setDefaultCACertificates()` replaces the default CA list for clients that
omit `ca`; combine current defaults and system roots to retain both.
### Resource management and diagnostics
Use `await using` with an open `fs.Dir` to close it at scope exit, or `using`
with `fs.mkdtempDisposableSync()` to remove a temporary directory and its
contents. Pass `autoClose: true` to `FileHandle.readableWebStream()` to close its
file handle when the stream finishes; the default is `false`.
Use the plural `util.getCallSites()` API and read `columnNumber` and `scriptId`
from its records. `TracingChannel` is stable. Its `tracePromise()` returns the
original thenable from the callback and also traces callbacks returning plain
values. See the diagnostics reference for channel names and inspector commands.
### Native integration
Include `<node_api.h>` directly when calling Node-API functions. Consult the
native reference for release-specific ABI and compiler requirements.
The experimental `node:ffi` loads dynamic libraries and calls native symbols:
enable it with `node --experimental-ffi app.mjs`, or with
`node --experimental-ffi --permission --allow-ffi app.mjs` under the Permission
Model. Finish using fast callables before closing their shared library.