You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ nvm use 12.14.1
Now using node v12.14.1 (npm v6.13.4)
$ node index
data { foo: 'bar' }
data null
$ nvm use 10.18.1
Now using node v10.18.1 (npm v6.13.4)
$ node index
data { foo: 'bar' }
$ nvm use 8
Now using node v8.11.3 (npm v5.6.0)
$ node index
data { foo: 'bar' } object
data null
It looks like in Node 10, there is only one readable event emitted when the stream is ended with data, whereas in Node versions 8 and 12, there is one readable emitted for the new data, and one with null to mark the end of the stream.
Is Node 10 also supposed to be emitting null as well when the stream closes?
The text was updated successfully, but these errors were encountered:
As far as I can see readable should always be emitted when a Readable is ended (push(null)). The code is pretty explicit about it. I'm not exactly sure why this is the case but I don't see any harm in it.
12.14.1, 10.18.1
Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
stream
Minimal example:
$ nvm use 12.14.1 Now using node v12.14.1 (npm v6.13.4) $ node index data { foo: 'bar' } data null
$ nvm use 10.18.1 Now using node v10.18.1 (npm v6.13.4) $ node index data { foo: 'bar' }
$ nvm use 8 Now using node v8.11.3 (npm v5.6.0) $ node index data { foo: 'bar' } object data null
It looks like in Node 10, there is only one
readable
event emitted when the stream is ended with data, whereas in Node versions 8 and 12, there is onereadable
emitted for the new data, and one withnull
to mark the end of the stream.Is Node 10 also supposed to be emitting
null
as well when the stream closes?The text was updated successfully, but these errors were encountered: