Watches a file and emits an event containing new data/lines
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

Build Status

FileNotify

Watchs a file and emits a 'data' event when new data/lines is saved to the watched file

Install

npm install filenotify

Usage

var FileNotify = require('filenotify');
var watcher = new FileNotify('/path/to/file');

watcher.on('data', function(data) {
  // data is the new line(s)
});

// Pause events
watcher.pause();

// Resume events (after pause)
watcher.resume();

// Stop
watcher.destroy();

// Start (after destroy)
watcher.start();

// Destroy after empting paused queue
watcher.destroySoon();