0.2.3 • Published 12 years ago

tailf v0.2.3

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

Watch a file changes and return a buffer with the new added data, for watch logs, etc.

simpleTailf

Simple watching file

Methods

start()

Start the watching of file.

stop()

Stop the watching of file.

on(event_name, callback)

Subscribe to event

Events

data

On data is added to file

error

On error watching the file

Usage:

var tailf = require('node-tailf');

var watchinglog = new tailf.simpleTailf('my.log');

watchinglog.on('data', function (data) {
    console.log('Data arrived: ' , data.toString());
});

blockTailf

Watching file and emit data splited by a string or regular expresion.

Methods

start()

Start the watching of file.

stop()

Stop the watching of file.

on(event_name, callback)

Subscribe to event

Events

data

On data is added to file

error

On error watching the file

Usage:

var tailf = require('node-tailf');

// emit a data event for once line
var watchinglog = new tailf.blockTailf('my.log',/\n/);

watchinglog.on('data', function (data) {
    console.log('Data arrived: ' , data);
});
0.2.3

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago