On this page

Deprecated APIs

History

The following APIs are deprecated and should no longer be used. Existing applications and modules should be updated to find alternative approaches.

M

util._extend

History
util._extend(target, source): void
Stability: 0Deprecated: Use Object.assign() instead.
Attributes
target:Object
source:Object

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):

M

util.isArray

History
util.isArray(object): boolean
Stability: 0Deprecated: Use Array.isArray() instead.
Attributes
object:any
Returns:boolean

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):