nodejs-tail
Simple NodeJs implementation of tail command
Last updated a year ago by vladimir-kazan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nodejs-tail 
SYNC missed versions from official npm registry.

nodejs-tail

Simple NodeJs implementation of tail command.

Install

yarn add nodejs-tail

Syntax

new Tail(filename, options)

  • filename - file to watch
  • options - chokidar watcher options, with hard coded next values: { alwaysStat: true, ignoreInitial: false, persistent: true, }

Example

const Tail = require('nodejs-tail');

const filename = 'some.log';
const tail = new Tail(filename);

tail.on('line', (line) => {
  process.stdout.write(line);
})

tail.on('close', () => {
  console.log('watching stopped');
})

tail.watch();

setTimeout(() => {
  tail.close();
}, 3000);

MIT License. Copyright (c) 2017 Vladimir Kuznetsov

Current Tags

  • 1.1.0                                ...           latest (a year ago)

3 Versions

  • 1.1.0                                ...           a year ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago

Copyright 2014 - 2017 © taobao.org |