1.0.3 • Published 7 years ago
iotdb-tail v1.0.3
iotdb-tail
Tail a file
usage
const tail = require("iotdb-tail")
const tailer = tail("file.txt")
tailer.on("line", line => console.log("+", line))
// later to stop
tailer.clear()features
This deals with:
file.txtnot existing (it will wait for it)file.txtbeing replacedfile.txtbeing emptied or made smaller
events
gone- the file has disappearedissue- some error or exception was seenline- a new linenew- a new file has appearedpartial- a result was so long we couldn't find a line, so deal with this yourselfreplaced- the file has been replaced by a new filereset- we went back to the beginning, because the file was made smaller