is-buffer
Determine if an object is a Buffer
Last updated 9 months ago by feross .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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

Get supported is-buffer with the Tidelift Subscription

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.4                                ...           latest (9 months ago)

15 Versions

  • 2.0.4                                ...           9 months ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.6                                ...           3 years ago
  • 1.1.5 [deprecated]           ...           3 years ago
  • 1.1.4 [deprecated]           ...           4 years ago
  • 1.1.3 [deprecated]           ...           4 years ago
  • 1.1.2 [deprecated]           ...           4 years ago
  • 1.1.1 [deprecated]           ...           4 years ago
  • 1.1.0 [deprecated]           ...           5 years ago
  • 1.0.2 [deprecated]           ...           5 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           6 years ago
Maintainers (1)
Downloads
Today 9,366
This Week 270,400
This Month 138,289
Last Day 65,123
Last Week 309,216
Last Month 1,519,660
Dependencies (0)
None
Dev Dependencies (3)
Dependents (416)

Copyright 2014 - 2017 © taobao.org |