Index of every page on this site: llms.txt
All skills
jasnell avatar

/node-modern-migration

@5f83e6c
Run it yourself

Fixes Node.js code that uses APIs removed or deprecated in v25-v28, or that relies on changed defaults. Use when upgrading Node.js; when fixing a DEP0xxx DeprecationWarning, ERR_UNKNOWN_BUILTIN_MODULE, "cannot be invoked without 'new'" or "is not a function" after an upgrade; or when reviewing code written for Node 22 or older. Covers SlowBuffer, fs.F_OK, fs.rmdir recursive, assert.CallTracker, node:_stream_*, crypto.fips, setEngine, CryptoKey in node:crypto, SHAKE outputLength, and the zlib/REPL classes that now need new. Also covers the new defaults for keepAliveTimeout (65s), Buffer.poolSize, readable.read() and localStorage. Node.js 24+.

Use this Skill: https://skilld.dev/gh/jasnell/node-skills/node-modern-migration

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

rulesdeprecations.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Deprecations that still work (v24 → main)

These still work but are on the removal track. Runtime deprecations print a DeprecationWarning once per process. Documentation-only ones are silent unless the docs say they support --pending-deprecation. Application deprecations warn only for code outside node_modules.

Versions are copied from the YAML changes: entries in doc/api/deprecations.md. Where the type changed, the version is that of the current type.

DEP API Type (since) Use instead
0032 node:domain Runtime (v27 alpha) AsyncLocalStorage, explicit error handling
0195 http.Agent(), ServerResponse(), IncomingMessage()… without new Runtime (v27 alpha; doc-only v24.2.0, v22.17.0) new http.Agent()
0199 require('node:_http_agent'), _http_client, _http_common, _http_incoming, _http_outgoing, _http_server Runtime (v27 alpha; doc-only v24.6.0, v22.19.0) node:http
0206 calling hmac.digest() twice (returns an empty buffer) Runtime (v27 alpha; doc-only v26.2.0, v24.18.0) create a new Hmac
0208 net.Server.prototype._listen2 Runtime (v27 alpha; doc-only v26.8.2, v24.22.0) server.listen()
0201 Duplex.toWeb(d, { type }) Runtime (v26.0.0; doc-only v25.7.0, v24.15.0) { readableType }
0031 ecdh.setPublicKey() Runtime (v25.0.0) nothing: the docs say the method is not useful
0187 fs.existsSync() with an invalid argument type Runtime (v24.0.0) pass a string, Buffer or URL
0190 spawn/execFile with args and shell: true Runtime (v24.0.0) drop shell and pass args, or escape the values yourself in one command string
0044 / 0060 util.isArray(), util._extend() Runtime Array.isArray(), Object.assign()
0005 new Buffer() / Buffer() Application Buffer.from(), Buffer.alloc()
0169 url.parse() (also url.format(string), url.resolve()) Application (v24.0.0) new URL()
0040 node:punycode Application a userland alternative (the docs name none)
0212 util.TextEncoder, util.TextDecoder Doc-only (main) the global TextEncoder/TextDecoder
0210 / 0211 sqlite.DatabaseSync, StatementSync Doc-only (v26.11.0) sqlite.Database, Statement. These names are not on v24.19 (verified), so keep the old names while v24 is supported
0209 AbortSignal used to dispose of long-lived resources (server.listen({ signal })) Doc-only (v26.8.2, v24.22.0) await using server = …
0207 stream.aborted / 'aborted' in node:http2 Doc-only (v27 alpha) 'error' with ERR_HTTP2_STREAM_ABORTED/ERR_HTTP2_STREAM_ERROR, 'close' + writableFinished
0202 HTTP/2 Http1IncomingMessage/Http1ServerResponse options Doc-only (v25.7.0, v24.15.0) http1Options: { IncomingMessage, ServerResponse }
0200 letting an fs.Dir be GC'd while open Doc-only (v24.9.0) dir.close() or await using dir = await opendir()
0197 util.types.isNativeError() Doc-only (v24.2.0) Error.isError() (present on v24.19, verified)
0196 { shell: '' } in child_process Doc-only (v24.2.0, v22.17.0) shell: true or omit it
0191 repl.builtinModules Doc-only, --pending-deprecation (v24.0.0, v22.16.0) module.builtinModules
0111 process.binding() Doc-only, --pending-deprecation public APIs (unavailable under the permission model)
0034 fs.exists(path, cb) Doc-only fs.access() / fs.stat()

Revoked: do not "fix" these

  • DEP0033 EventEmitter.listenerCount(): revoked in v25.4.0 and v24.14.0.
  • DEP0116 legacy URL API: revoked. url.parse() is still deprecated under DEP0169.
  • DEP0163 channel.subscribe()/unsubscribe(): revoked in v24.8.0 and v22.20.0.

Finding them

node --throw-deprecation app.js        # turn every runtime deprecation into an exception
node --pending-deprecation app.js      # also warn for the --pending-deprecation doc-only ones
node --trace-deprecation app.js        # print a stack trace for each warning

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    This skill provides technical documentation and code examples to assist in migrating Node.js applications from version 24 to newer releases. It details API removals, deprecations, and changed defaults, using local verification scripts to ensure environment compatibility without any malicious behavior.

  • Socket5d

    No alerts

  • Snyk5d

    Risk: LOW · No issues

Signed by skilld at 5f83e6c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated last week

README badge

README badge for jasnell/node-skills/node-modern-migration