Closed ehmicky closed 1 year ago
import { Readable } from 'node:stream' import { setTimeout } from 'node:timers/promises' import getStream from 'get-stream' const stream = Readable.from([]) stream.read() await setTimeout(0) await getStream(stream) console.log('done')
With Node >=18.14.0 and >=19.5.0, done is not printed. With Node <18.4.0 and <19.5.0, done is printed.
done
In other words, get-stream never completes when the stream has already ended.
get-stream
This seems to be a bug with Node.js: https://github.com/nodejs/node/issues/46595
This is related to the following line in get-stream:
https://github.com/sindresorhus/get-stream/blob/8f004f946a6882c21173747094b65663a5218bd6/index.js#L41
This was fixed by Node 19.8.0.
19.8.0
With Node >=18.14.0 and >=19.5.0,
done
is not printed. With Node <18.4.0 and <19.5.0,done
is printed.In other words,
get-stream
never completes when the stream has already ended.This seems to be a bug with Node.js: https://github.com/nodejs/node/issues/46595
This is related to the following line in
get-stream
:https://github.com/sindresorhus/get-stream/blob/8f004f946a6882c21173747094b65663a5218bd6/index.js#L41