Socket
Book a DemoInstallSign in
Socket

is-buffer

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-buffer

Determine if an object is Buffer

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
18M
-8.95%
Maintainers
1
Weekly downloads
 
Created
Source

is-buffer travis npm downloads

Determine if an object is a Buffer (incl. browser buffers).

testling

Why not use Buffer.isBuffer?

If you just want to check if an object is a Buffer without require('buffer') (which bundles the entire buffer module in browserify), then use this module. 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.

Keywords

buffer

FAQs

Package last updated on 31 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts