Deprecated APIs
History
Introduced in: v0.10.0
v0.10.0
The following APIs are deprecated and should no longer be used. Existing applications and modules should be updated to find alternative approaches.
util._extend(target, source): void
Stability: 0Deprecated: Use
Object.assign() instead.Attributes
The util._extend() method was never intended to be used outside of internal
Node.js modules. The community found and used it anyway.
It is deprecated and should not be used in new code. JavaScript comes with very
similar built-in functionality through Object.assign().
An automated migration is available (source):
npx codemod@latest @nodejs/util-extend-to-object-assign
util.isArray(object): boolean
Stability: 0Deprecated: Use
Array.isArray() instead.Attributes
Alias for Array.isArray().
Returns true if the given object is an Array. Otherwise, returns false.
const util = require('node:util'); util.isArray([]); // Returns: true util.isArray(new Array()); // Returns: true util.isArray({}); // Returns: false
An automated migration is available (source):
npx codemod@latest @nodejs/util-is