node.js tail implementation
Install
$ npm install node.tail
Usage
new Tail(target, options);
var Tail = ;var tailFile = 'fileName.log'follow: true lines: 20;tailFile;tailFile;
Options
Optional. Default values:
buffer: 63 * 1024 - 1 //max value sep: '\n' //Line separator lines: 10 //how much lines show from end (tail -n 10) follow: false //(tail -F) sleep: 500 //how often the target should be polled in ms(tail -s 0.5)
Events
line
- line String next line from the target
error
- error Error object