Compared with 25.2.0: `node:buffer:AllowSharedBuffer`, `node:buffer:NonSharedBuffer`, `node:child_process:ExecFileOptionsWithOtherEncoding`, `node:child_process:ExecFileException`, `node:crypto:fips`, and 92 more. 24 newly deprecated.
@types/node 25.2.0 → 26.6.5: deprecates 97 API(s): from its source to your code
node:buffer:AllowSharedBuffer: This is intended for internal use, and will be removed once `@types/node` no longer supports TypeScript versions earlier than 5.7.
node:buffer:NonSharedBuffer: This is intended for internal use, and will be removed once `@types/node` no longer supports TypeScript versions earlier than 5.7.
node:child_process:ExecFileOptionsWithOtherEncoding: Use `ExecFileOptions` instead.
node:child_process:ExecFileException: This deprecated alias will be removed in a future version. Use `ExecException` instead.
node:crypto:fips: This property is deprecated. Please use `crypto.setFips()` and `crypto.getFips()` instead.
node:crypto:BinaryToTextEncoding: This type will be removed in a future version. Use `BufferEncoding` instead.
node:crypto:CharacterEncoding: This type will be removed in a future version. Use `BufferEncoding` instead.
node:crypto:LegacyCharacterEncoding: This type will be removed in a future version. Use `BufferEncoding` instead.
node:crypto:Encoding: This type will be removed in a future version. Use `BufferEncoding` instead.
node:crypto:CipherKey: This type will be removed in a future version. Use `KeyLike` instead.
node:crypto:RsaPublicKey: This type will be removed in a future version.
node:crypto:RsaPrivateKey: This type will be removed in a future version.
node:fs:lchmod: Changes the permissions on a symbolic link. No arguments other than a possible exception are given to the completion callback. This method is only implemented on macOS. See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. Since v0.4.7
node:fs:lchmodSync: Changes the permissions on a symbolic link. Returns `undefined`. This method is only implemented on macOS. See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. Since v0.4.7
node:fs:exists: Test whether or not the given path exists by checking with the file system. Then call the `callback` argument with either true or false: ```js import { exists } from 'node:fs'; exists('/etc/passwd', (e) => { console.log(e ? 'it exists' : 'no passwd!'); }); ``` **The parameters for this callback are not consistent with other Node.js** **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback has only one boolean parameter. This is one reason `fs.access()` is recommended instead of `fs.exists()`.
node:fs:StatSyncFn: This orphaned interface will be removed in a future version.
node:fs:RmDirOptions: `rmdir()` no longer provides any options. This interface will be removed in a future version.
node:fs:StatSyncOptions: This orphaned interface will be removed in a future version. Use `StatOptions` instead.
node:fs/promises:lchmod: Changes the permissions on a symbolic link. This method is only implemented on macOS. Since v10.0.0
node:fs/promises:FileReadOptions: This interface will be removed in a future version. Use `import { ReadOptionsWithBuffer } from "node:fs"` instead.
node:module:register: Register a module that exports hooks that customize Node.js module resolution and loading behavior. See [Customization hooks](https://nodejs.org/docs/latest-v26.x/api/module.html#customization-hooks). This feature requires `--allow-worker` if used with the [Permission Model](https://nodejs.org/docs/latest-v26.x/api/permissions.html#permission-model). Use `module.registerHooks()` instead.
node:punycode:ucs2: since v7.0.0 The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be removed. Users currently depending on the punycode module should switch to using the userland-provided Punycode.js module instead.
node:punycode:version: since v7.0.0 The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be removed. Users currently depending on the punycode module should switch to using the userland-provided Punycode.js module instead.
node:readline:ReadLine: This alias will be removed in a future version. Use `import { Interface } from 'node:readline'` instead.
node:stream:ArrayOptions: Use `ReadableOperatorOptions` instead.
node:url:parse: The `url.parse()` method takes a URL string, parses it, and returns a URL object. A `TypeError` is thrown if `urlString` is not a string. A `URIError` is thrown if the `auth` property is present but cannot be decoded. `url.parse()` uses a lenient, non-standard algorithm for parsing URL strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted input. CVEs are not issued for `url.parse()` vulnerabilities. Use the [WHATWG URL](https://nodejs.org/docs/latest-v26.x/api/url.h
node:url:format: The `url.format()` method returns a formatted URL string derived from `urlObject`. ```js import url from 'node:url'; url.format({ protocol: 'https', hostname: 'example.com', pathname: '/some/path', query: { page: 1, format: 'json', }, }); // => 'https://example.com/some/path?page=1&format=json' ``` If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. The formatting process operates as follows: * A new empty string `result` is created. * If `urlObject.protocol` is a string, it is appended as-is to `result`. * Otherwise, if `urlObject.protocol` is not `undef
node:url:resolve: The `url.resolve()` method resolves a target URL relative to a base URL in a manner similar to that of a web browser resolving an anchor tag. ```js import url from 'node:url'; url.resolve('/one/two/three', 'four'); // '/one/two/four' url.resolve('http://example.com/', '/one'); // 'http://example.com/one' url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' ``` Because it invokes the deprecated `url.parse()` internally, `url.resolve()` is itself deprecated. To achieve the same result using the WHATWG URL API: ```js function resolve(from, to) { const resolvedUrl = new URL(t
node:util:isArray: Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. ```js import util from 'node:util'; util.isArray([]); // Returns: true util.isArray(new Array()); // Returns: true util.isArray({}); // Returns: false ``` Since v4.0.0 - Use `isArray` instead.
node:util/types:isNativeError: Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). ```js console.log(util.types.isNativeError(new Error())); // true console.log(util.types.isNativeError(new TypeError())); // true console.log(util.types.isNativeError(new RangeError())); // true ``` Subclasses of the native error types are also native errors: ```js class MyError extends Error {} console.log(util.types.isNativeError(new MyError())); // true ``` A value being `instanceof` a native error class is not equivalent to `isNativeError()` returning `true`
node:buffer:AllowSharedBuffer.slice: Returns a new `Buffer` that references the same memory as the original, but offset and cropped by the `start` and `end` indices. This method is not compatible with the `Uint8Array.prototype.slice()`, which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. ```js import { Buffer } from 'node:buffer'; const buf = Buffer.from('buffer'); const copiedBuf = Uint8Array.prototype.slice.call(buf); copiedBuf[0]++; console.log(copiedBuf.toString()); // Prints: cuffer console.log(buf.toString()); // Prints: buffer // With buf.slice(), the original buffer is modified. const
node:buffer:Buffer.slice: Returns a new `Buffer` that references the same memory as the original, but offset and cropped by the `start` and `end` indices. This method is not compatible with the `Uint8Array.prototype.slice()`, which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. ```js import { Buffer } from 'node:buffer'; const buf = Buffer.from('buffer'); const copiedBuf = Uint8Array.prototype.slice.call(buf); copiedBuf[0]++; console.log(copiedBuf.toString()); // Prints: cuffer console.log(buf.toString()); // Prints: buffer // With buf.slice(), the original buffer is modified. const
node:buffer:NonSharedBuffer.slice: Returns a new `Buffer` that references the same memory as the original, but offset and cropped by the `start` and `end` indices. This method is not compatible with the `Uint8Array.prototype.slice()`, which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. ```js import { Buffer } from 'node:buffer'; const buf = Buffer.from('buffer'); const copiedBuf = Uint8Array.prototype.slice.call(buf); copiedBuf[0]++; console.log(copiedBuf.toString()); // Prints: cuffer console.log(buf.toString()); // Prints: buffer // With buf.slice(), the original buffer is modified. const
node:cluster:Cluster.isMaster: since v16.0.0 - use isPrimary.
node:cluster:Cluster.setupMaster: since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v26.x/api/cluster.html#clustersetupprimarysettings) instead.
node:dns:LookupOptions.verbatim: When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder} Please use `order` option
node:http:OutgoingMessage.finished: Use `writableEnded` instead.
node:http:OutgoingMessage.connection: Alias of `outgoingMessage.socket`. Since v15.12.0,v14.17.1 - Use `socket` instead.
node:http:ServerResponse.finished: Use `writableEnded` instead.
node:http:ServerResponse.connection: Alias of `outgoingMessage.socket`. Since v15.12.0,v14.17.1 - Use `socket` instead.
node:http:ClientRequestEventMap.abort: Listen for the `'close'` event instead.
node:http:ClientRequest.aborted: The `request.aborted` property will be `true` if the request has been aborted. Since v17.0.0, v16.12.0 - Check `destroyed` instead.
node:http:ClientRequest.abort: Marks the request as aborting. Calling this will cause remaining data in the response to be dropped and the socket to be destroyed. Since v14.1.0,v13.14.0 - Use `destroy` instead.
node:http:ClientRequest.finished: Use `writableEnded` instead.
node:http:ClientRequest.connection: Alias of `outgoingMessage.socket`. Since v15.12.0,v14.17.1 - Use `socket` instead.
node:http:IncomingMessageEventMap.aborted: Listen for `'close'` event instead.
node:http:IncomingMessage.aborted: The `message.aborted` property will be `true` if the request has been aborted. Since v17.0.0,v16.12.0 - Check `message.destroyed` from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
node:http:IncomingMessage.connection: Alias for `message.socket`. Since v16.0.0 - Use `socket`.
node:http2:Http2Stream.priority: Priority signaling is no longer supported in Node.js.
node:http2:ServerSessionOptions.Http1IncomingMessage: Use `http1Options.IncomingMessage` instead.