sindresorhus / get-stream

Get a stream as a string, Buffer, ArrayBuffer or array
MIT License
341 stars 33 forks source link

The `error` event is not cleaned up on successful read #36

Closed szmarczak closed 4 years ago

szmarczak commented 4 years ago
const getStream = require('get-stream');
const {Readable} = require('stream');

const stream = new Readable({
    read() {
        this.push('chunk');
        this.push(null);
    }
});

const buffer = await getStream.buffer(stream);

console.log(stream.listenerCount('error')); // => 1
szmarczak commented 4 years ago

~#21 should fix this~ https://github.com/nodejs/node/issues/32995

szmarczak commented 4 years ago

wontfix