bl icon indicating copy to clipboard operation
bl copied to clipboard

Added join function

Open yuyaryshev opened this issue 5 years ago • 1 comments

Added join function defragments BufferList items into one big buffer.

yuyaryshev avatar Aug 24 '20 06:08 yuyaryshev

OK, so this is essentially just a bare slice() where you're mutating an existing instance rather than returning a new one (or a Buffer). It feels a little like API fluff, although there is that minor difference in the mutation which is currently not possible.

What I'd like to know is what the use-case for this is? Why is fred.join() superior to fred = BufferList(fred.slice())? What are the scenarios where you want to keep a BufferList reference that's flattened internally and not just use a Buffer?

Needs linting, a test or three, and README.md additions.

rvagg avatar Dec 07 '20 00:12 rvagg