is-buffer (1.1.6)

Published 2026-02-24 13:58:19 +00:00 by atheaadmin

Installation

registry=
npm install is-buffer@1.1.6
"is-buffer": "1.1.6"

About this package

is-buffer travis npm downloads javascript style guide

Determine if an object is a Buffer (including the browserify Buffer)

saucelabs

Why not use Buffer.isBuffer?

This module lets you check if an object is a Buffer without using Buffer.isBuffer (which includes the whole buffer module in browserify).

It's future-proof and works in node too!

install

npm install is-buffer

usage

var isBuffer = require('is-buffer')

isBuffer(new Buffer(4)) // true

isBuffer(undefined) // false
isBuffer(null) // false
isBuffer('') // false
isBuffer(true) // false
isBuffer(false) // false
isBuffer(0) // false
isBuffer(1) // false
isBuffer(1.0) // false
isBuffer('string') // false
isBuffer({}) // false
isBuffer(function foo () {}) // false

license

MIT. Copyright (C) Feross Aboukhadijeh.

Dependencies

Development Dependencies

ID Version
standard *
tape ^4.0.0
zuul ^3.0.0

Keywords

buffer buffers type core buffer browser buffer browserify typed array uint32array int16array int32array float32array float64array browser arraybuffer dataview
Details
npm
2026-02-24 13:58:19 +00:00
1
Feross Aboukhadijeh
MIT
latest
2.3 KiB
Assets (1)
Versions (1) View all
1.1.6 2026-02-24