-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement write methods #23
Conversation
for (var m in methods) { | ||
(function(m) { | ||
BufferList.prototype[m] = function(value) { | ||
var buf = new Buffer(methods[m]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no semicolons please
} | ||
|
||
for (var m in methods) { | ||
(function(m) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move the function out of the for loop, but that's a stylistic thing
I'm 👍 on that, but I would add them only if we support also the |
@mcollina I'm not sure I understand the logic of the |
@reklatsmasters that's my point. If we are calling them write*, then we should support the Buffer API. Otherwise we can call them append*, which will clarify their meaning and avoid confusion. |
I'm +1 on this. More comptibility with the Buffer API sounds good to me. I agree with @mcollina, behavior should be the same. |
Just to be clear, I'm 100% fine in adding a bunch of append* methods, which I think would possibly make more sense than writing to the beginning of the list. We should probably support both in the long run. |
I'm 👍 on this. If it's ok for the others, I'd recommend you update the README as well with the new APIs. |
I think for me it would be very hard to write correct README without help in pure English 😕 |
@reklatsmasters write it, we'll tell you what to fix :) |
@mcollina Sorry, i`m forgot about this PR) Is this doc correct?
|
I will write all of them down here, for new users sake. |
Ping, any updates on this one? |
I created my own library for this: https://www.npmjs.com/package/buffer-array. |
Ok, thanks anyway! |
Implement all
writeXXX
methods from Buffer prototype