fsnotifier

0.0.8 • Public • Published

fsnotifier

A Node.js module for tracking appends to a file.

fsnotifier will emit change events for each chunk of appends to a file. It continuously polls the file and waits for it to stabalize, then it emits a change event with a readable stream of the changes.

Install

$ npm install fsnotifier

Usage

Initialize a notifier for a file:

var notifier = require('fsnotifier');

var n = notifier('logfile.txt');

// register a listener to the change event and pipe the changes to stdout
n.on('change', function(stream) {
  stream.pipe(process.stdout);
});

// stop notifications
n.close();

Package Sidebar

Install

npm i fsnotifier

Weekly Downloads

2

Version

0.0.8

License

ISC

Last publish

Collaborators

  • fortruce