Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Nodejs module for tailing a file
CoffeeScript
Branch: master
Pull request Compare This branch is 2 commits ahead, 44 commits behind lucagrulla:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
node_modules
Cakefile
README.md
package.json
tail.coffee

README.md

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.

Something went wrong with that request. Please try again.