Nanoscale Parts Manufacturing
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    touch-and-gopublic

    TouchAndGo

    simple directory watcher(fs.watch wrapper)

    Usage

    $npm install touch-and-go
    

    then

    var Watcher = require('touch-and-go').Watcher;
    var watcher = new Watcher('/path/to/somewhere',function(o){return /\.txt$/.test(o)});
    // or 
    // var w = require('touch-and-go').watcher; 
    // var watcher = w('/path/to/somewhere',function(o){return /\.txt$/.test(o)}); 
     
    // added or changed 
    watcher.on('changed',function(filepath){
      console.log('abs path: '+filepath);
    });
     
    // removed 
    watcher.on('removed',function(filepath){
      // do something 
    });
     
    // start observing 
    watcher.start();
     
    // stop observing 
    watcher.stop();

    Keywords

    none

    install

    npm i touch-and-go

    Downloadsweekly downloads

    0

    version

    0.0.1

    license

    none

    last publish

    collaborators

    • avatar