1.0.0 • Published 9 years ago

dir_watchdog v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

dir_watchdog

PayPayl donate button npm version fs version array-difference version readdirp version

  • This is a directory/folder watchdog tool.

Overview

Getting Started

npm install dir_watchdog

Usage

var dw = require('dir_watchdog');
var option = new Object();
option.rootpath = "./myfile";             //default path : "./"
option.timer = 1000;                        //default : 2000 millionseconds detect.
dw.watchdog(option, function(ret, files, dirs)
{
  //catch event msg.
  switch(ret)
  {
      case "init":
        showlog(ret, files, dirs);
        break;
      case "create":
        showlog(ret, files, dirs);
        break;
      case "delete":
        showlog(ret, files, dirs);
        break;
      case "change":
        showlog(ret, files, dirs);
        break;
      default:
        break;
  }
});
function showlog(ret, files, dirs)
{
    console.log(ret);
    console.log("=====files=====");
    console.log(files);
    console.log("=====directories=====");
    console.log(dirs);
}

Result

  • init:
  • create: ( hello file)
  • delete: ( hello file)
  • changerename: ( hello -> hello_rename file)
  • changemove: ( ../myfile/hello_rename → ../myfile/test/hello__rename file)

License

  • SEE Linence
1.0.0

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago