sindresorhus/get-stream

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

Closed this issue · 2 comments

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

#21 should fix this nodejs/node#32995

wontfix