Comments (16)
@phated Is this is a node.js or browserify SlowBuffer
? If node.js, what version are you using?
Can you share sample code where you expect this package to return true
?
from is-buffer.
I can't reproduce. In node v4 and browserify, this works as expected:
var isBuffer = require('is-buffer')
isBuffer(new require('buffer').SlowBuffer(1000)) // true
from is-buffer.
@phated Ping.
from is-buffer.
Sorry for the delay. I just tried your example in node 0.10 and it fails.
from is-buffer.
Looks like it is working in >=0.12 (which is weird, because our vinyl-fs tests were failing on that version too).
from is-buffer.
Ah, this is because SlowBuffer
is a different class in node 0.10 and there's no SlowBuffer.isBuffer
method.
from is-buffer.
Have you considered just dropping node 0.10 support? It's going to be completely unsupported (even no security updates) in October 2016.
from is-buffer.
Nope. It is still maintained, has tons of users and I personally see it as the most stable version of node (still).
from is-buffer.
If you don't plan to support it, can you mark the package with engines
so devs will be warned when attempting to use it? I shipped a broken version of vinyl-fs due to this problem.
from is-buffer.
Another note: Buffer.isBuffer()
in node 0.10 correctly identifies the SlowBuffer, which is what I switched to.
from is-buffer.
If you're in node, you can of course use Buffer.isBuffer()
. The primary purpose of this package is to avoid including the whole Buffer
package in your browser javascript bundle if you just need to check if something is a buffer because normally it will be included if you do Buffer.isBuffer()
.
Is vinyl-fs
supposed to work with browserify?
from is-buffer.
@feross yeah, in 2.0 removed the watch
method so there were no native modules and we recently received an issue related to someone browserifying the package.
from is-buffer.
If you're not carefully curating your node package dependencies to ensure that no one is calling require('buffer')
or using the Buffer
global, then the whole buffer package will end up in the browser bundle anyway, so I'd just continue using Buffer.isBuffer()
.
Thanks for opening the issue and sorry for breaking your package.
from is-buffer.
For example, one of your dependencies uses buffer here.
from is-buffer.
Thanks. I really hope you update the package.json to note the engine dependency. You don't have to use engineStrict
but the warning would be really helpful.
from is-buffer.
Sure thing.
from is-buffer.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from is-buffer.