soldair / node-tailfd

Tail a file. This will continue to work even if a file is unlinked rotated or truncated. It is also ok if the path doesnt exist before watching it
MIT License
8 stars 1 forks source link

Build Status

tailfd

Tails a file. it should work great. it will continue to work even if a file is unlinked rotated or truncated. It is also ok if the path doesnt exist before watching it

Example


var tail = require('tailfd').tail,
watcher = tail('/some.log',function(line,tailInfo){
  //default line listener. optional.
  console.log('line of data> ',line);
});

when you are done

watcher.close();

install

npm install tailfd

argument structure

tailfd.tail(filename, [options], listener)

Watcher.pause

Watcher.resume

events

events inherited from watchfd

tailInfo properties

watch file and watch may behave differently on different systems here is the doc for it.