is-buffer
Determine if an object is a Buffer
Last updated a year 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 (a year ago)

15 Versions

  • 2.0.4                                ...           a year ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.1.6                                ...           3 years ago
  • 1.1.5 [deprecated]           ...           4 years ago
  • 1.1.4 [deprecated]           ...           4 years ago
  • 1.1.3 [deprecated]           ...           5 years ago
  • 1.1.2 [deprecated]           ...           5 years ago
  • 1.1.1 [deprecated]           ...           5 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 29,622
This Week 29,622
This Month 1,108,229
Last Day 19,807
Last Week 386,940
Last Month 1,608,676
Dependencies (0)
None
Dev Dependencies (3)
Dependents (436)

Copyright 2014 - 2016 © taobao.org |