Juul / tail-stream

Like `tail -f` but a stream. Like fs.createReadStream but keeps reading as the file grows.
Other
33 stars 13 forks source link

Added checks to avoid crashes. #9

Closed plastbox closed 7 years ago

plastbox commented 7 years ago

Added checks to avoid crashes when calling end() during the "read-up" fase (as opposed to the active tailing fase), or when calling it more than once.

The real-world case would be ending the (tail-)stream if the data read matches a defined end condition, f.ex. when using this module and some "glue" to sequentially read a collection of log files [and pass the data through byline or similar], and ending the stream once you get to your desired [potentially future] date/time.

Juul commented 7 years ago

Hi. Thanks for the pull request but why did you close it? Is it broken or was it a mistake?