paulmillr / readdirp

Recursive version of fs.readdir with streaming api.
https://paulmillr.com
MIT License
378 stars 51 forks source link

fix streams behavior #106

Closed ronag closed 4 years ago

ronag commented 4 years ago

Fixes some minor streams related issues.

This ensures that it behaves like a "proper" stream and follows expectations.

paulmillr commented 4 years ago

Thanks! That’s helpful. This is my first big experience with custom streams. Any good resource on how to properly write them? The core source code is kinda awful.

ronag commented 4 years ago

@paulmillr: Np.

The streams docs are probably the best resources. I would recommend to read the latest version on github https://github.com/nodejs/node/tree/master/doc which has a lot of recent improvements not available on nodejs.org. Streams are unfortunately quite difficult with a lot of edge cases. However, Node and myself are working on improving both the code and the docs.

readdirp is a quite heavily used lib (by myself as well through chokidar). If you need help reviewing streams related stuff feel free to ping me.