Currently createReadStream throws an ENOENT if trying to follow a file that does not (yet) exist.
This PR adds a waitForCreate option (default off) that makes tail-stream to wait for the file to be created using the same mechanism that currently is used for moved files.
Changes are quite minimal otherwise, but I had to put the initialization code to a separate method that's called at the end of the constructor. Otherwise the necessary methods aren't declared when needed.
Currently
createReadStream
throws anENOENT
if trying to follow a file that does not (yet) exist. This PR adds awaitForCreate
option (default off) that makes tail-stream to wait for the file to be created using the same mechanism that currently is used for moved files.Changes are quite minimal otherwise, but I had to put the initialization code to a separate method that's called at the end of the constructor. Otherwise the necessary methods aren't declared when needed.