Then use Buffer.isBuffer (same as Lodash in Node).
Missing Buffer → treat as not a buffer.
Bundlers that inject Buffer make Lodash’s _.isBuffer work too.
Compatibility
Browser & Runtime Support
_.isBuffer is a Lodash Lang helper (since 4.3.0). It is most useful in Node.js (and Deno/Bun with Buffer). In browsers it only returns meaningful true when Buffer is available at Lodash load (bundler) or you call Buffer.isBuffer after a polyfill.
✓ Stable · Lodash 4.3.0+
_.isBuffer()
Available in [email protected]. Best in Node. Browser CDN builds often stub to false — prefer Buffer.isBuffer for polyfilled demos.
Node-firstWith Buffer available
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.isBufferLodash 4.3.0+
Bottom line: In Node, _.isBuffer mirrors Buffer.isBuffer. In bare browser + CDN Lodash, expect false unless you bundle Buffer before Lodash initializes.
Frequently Asked Questions
_.isBuffer(value) returns true if value is a Node.js Buffer instance. It forwards to Buffer.isBuffer when Buffer is available; otherwise it returns false.
No. A plain Uint8Array is not a Buffer. Buffer extends Uint8Array in modern Node, but Buffer.isBuffer distinguishes real Buffer instances.
No. ArrayBuffer is raw memory. Buffer is a Node view/API over bytes. Use _.isArrayBuffer for ArrayBuffer and _.isBuffer for Buffer.
lodash.min.js wires _.isBuffer to a false stub when Buffer is missing at load time. Polyfilling Buffer later does not change that stub. Use Buffer.isBuffer in browser demos, or bundle Lodash with Buffer available.
No. new Buffer() is deprecated and unsafe for untrusted input. Prefer Buffer.alloc, Buffer.allocUnsafe, or Buffer.from.
Use import isBuffer from "lodash/isBuffer" or require("lodash/isBuffer") for tree-shaking. Full build: import _ from "lodash" then _.isBuffer.