Skip to main content

isBuffer

function isBuffer
Jump to headingisBuffer(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 Jump to heading

Jump to headingobject: unknown

Return Type Jump to heading

object is Buffer
Back to top