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.
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.