Skip to content

Add option to not implicitly end when there is nothing to read() #46

@kanongil

Description

@kanongil

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();
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions