Skip to content

itoys/node.tail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node.js tail implementation

Install

$ npm install node.tail

Usage

new Tail(target, options);

var Tail = require('node.tail');
var tailFile = new Tail('fileName.log',{follow: true, lines: 20});
tailFile.on('line', console.log);
tailFile.on('error', console.error);

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published