is-buffer
Determine if an object is a Buffer
Last updated 4 years ago by feross .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-buffer 
SYNC missed versions from official npm registry.

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(Buffer.alloc(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.

Current Tags

  • 2.0.5                                ...           latest (4 years ago)

16 Versions

  • 2.0.5                                ...           4 years ago
  • 2.0.4                                ...           5 years ago
  • 2.0.3                                ...           6 years ago
  • 2.0.2                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.1.6                                ...           7 years ago
  • 1.1.5 [deprecated]           ...           8 years ago
  • 1.1.4 [deprecated]           ...           8 years ago
  • 1.1.3 [deprecated]           ...           9 years ago
  • 1.1.2 [deprecated]           ...           9 years ago
  • 1.1.1 [deprecated]           ...           9 years ago
  • 1.1.0 [deprecated]           ...           9 years ago
  • 1.0.2 [deprecated]           ...           10 years ago
  • 1.0.1 [deprecated]           ...           10 years ago
  • 1.0.0 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |