Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A basic recursive file system watcher for node.js.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
.npmignore
README.md
package.json

README.md

Watchn

A basic recursive file system watcher for node.js.

To use specify:

  • a starting directory
  • a regular expression that matches the files to watch
  • a function to call when a match is detected

Eg

var exec = require('child_process').exec,
    watch = require('watchn').watch;

watch('.', /.+\.js/, function (path, curr, prev) {
    console.log('change detected... ' + path);
    exec('cat ' + path, function (error, stdout, stderr) {
        console.log(stdout);
    });
}); 

Acknowledgement

The functionality of this project is a ripoff of watchr. The code is largely stolen from node-supervisor

Something went wrong with that request. Please try again.