Skip to content

LeoIannacone/node-tail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#tail

To install:

npm install tail

#Use:

Tail = require('tail').Tail;

tail = new Tail("fileToTail");

tail.on("line", function(data) {
  console.log(data);
});

tail.on("error", function(error) {
  console.log('ERROR: ', error);
});

Tail accepts the line separator as second parameter. If nothing is passed it is defaulted to new line '\n'.

var lineSeparator= "-";

new Tail("fileToTail",lineSeparator)

Tail emits two type of events:

  • line
function(data){}
  • error
function(exception){}

If you simply want to stop the tail:

tail.unwatch()

And to start watching again:

tail.watch()

#Want to fork ?

Tail is written in CoffeeScript.

The Cakefile generates the javascript that is then published to npm.

#License MIT. Please see License file for more details.

About

Nodejs module for tailing a file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 92.1%
  • JavaScript 4.4%
  • Ruby 3.5%