Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 822 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 822 Bytes

node-tailer

node-tailer tries to be the node.js equivalent of 'tail -F <file>'

#tailer

To install:

npm install tailer

or add tailer to package.json and run 'npm install'

#Use:

Tailer = require('tailer');

tailer = new Tailer("/var/log/messages", {fromstart: true, delay: 500});

tailer.tail(function(err, line){
	//Do something with the new line in the tailed file
});

//When you want to stop tailing:

tailer.untail();

Currently you can supply 2 options to the Tailer constructor:

  • fromstart - Tells the tailer to read the file from the start and output all existing lines. If false (default), it will only tail new lines added to the file after the tailer has been created.
  • delay - This is the delay in ms (default 1000) between 2 consecutive reads in the file.