Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/ext/node/polyfills/buffer.ts>Buffer.isBuffer

A modern runtime for JavaScript and TypeScript.
Latest
method Buffer.isBuffer
import { Buffer } from "https://deno.land/x/deno@v2.0.4/ext/node/polyfills/buffer.ts";

Returns true if obj is a Buffer, false otherwise.

import { Buffer } from "ext:deno_node/internal/buffer";

Buffer.isBuffer(Buffer.alloc(10)); // true
Buffer.isBuffer(Buffer.from('foo')); // true
Buffer.isBuffer('a string'); // false
Buffer.isBuffer([]); // false
Buffer.isBuffer(new Uint8Array(1024)); // false

Parameters

obj: unknown