Determine if an object is a Buffer.
Documentation | npm | Issues | Repository
Current package version: 1.0.2
@stackline/is-buffer is the Stackline-maintained distribution of is-buffer@2.0.5. It is an independent continuation of is-buffer; original authors and licenses remain credited below.
| Item | Value |
|---|---|
| Package | @stackline/is-buffer@1.0.2 |
| API target | is-buffer@2.0.5 |
| Supported Node.js | >=4 |
| License | MIT |
| Main entry | index.js |
| Runtime dependencies | none |
npm install @stackline/is-bufferPreserve existing imports and plugin resolution with an npm alias:
npm install is-buffer@npm:@stackline/is-bufferDetermine if an object is a Buffer (including the browserify Buffer)
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!
npm install @stackline/is-buffervar isBuffer = require('@stackline/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 () {}) // falseMIT. Copyright (C) Feross Aboukhadijeh.
- Original project: is-buffer.
- Feross Aboukhadijeh.
- Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.
Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.
MIT. See the license and notice files in the repository.
Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.