Skip to main content
function isBuffer
isBuffer(object: unknown): object is Buffer
Deprecated

Returns true if the given object is a Buffer. Otherwise, returns false.

import util from 'node:util';

util.isBuffer({ length: 0 });
// Returns: false
util.isBuffer([]);
// Returns: false
util.isBuffer(Buffer.from('hello world'));
// Returns: true

Parameters

object: unknown

Return Type

object is Buffer
Back to top