bl
bl copied to clipboard
Add option to not implicitly end when there is nothing to read()
I have a use case, where I create a BufferList that is piped to a processor.
I want to be able to setup the bl.pipe(processor) before I even start to feed data into the bufferlist. When I try that, the bufferlist immediately ends.
Failing example:
const Stream = require('stream');
const BufferList = require('bl');
const bl = new BufferList();
const processor = new BufferList((err, buffer) => { // Can be any writable
console.log('result:', buffer.toString());
});
bl.pipe(processor);
setImmediate(() => {
bl.append('hello');
bl.end();
});