3 ms·
Readable-streams v3 (https://www.nearform.com/blog/welcome-readable-stream-3/ https://www.nearform.com/blog/welcome-readable-stream-3/) allows you to use async
by loige 8y ago
Readable-streams v3 (https://www.nearform.com/blog/welcome-readable-stream-3/ https://www.nearform.com/blog/welcome-readable-stream-3/) allows you to use async iterators to process streams (`for...await...of` syntax).
This is actually in Node.js current, check out stream docs: https://nodejs.org/api/stream.html#stream_readable_symbol_asynciterator https://nodejs.org/api/stream.html#stream_readable_symbol_as...
- jondubois 8y agoI did consider using the Node.js streams at one point but they support a lot of legacy edge cases and are more relevant for I/O than just a simple event stream (which was my use case). My stream library is less than 100 lines of code and only supports asyncIterator interface; also, it supports multiple concurrent consumers; each consuming at its own pace.