0.2.4 • Published 12 years ago

tail2 v0.2.4

Weekly downloads
6
License
-
Repository
github
Last release
12 years ago

#tail

To install:

npm install tail

#Use:

Tail = require('tail').Tail;

tail = new Tail("fileToTail");

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

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()

#Want to fork ?

Tail is written in CoffeeScript.

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