watch-project

watch directory change, emit events including create, change, mv, remove, mkdir, mvdir, rmdir as exactly as there is

npm install watch-project
17 downloads in the last week
33 downloads in the last month

Installation

npm install watch-project

Usage

watch = require("watch-project");

watch("dir", {stable: true}, function(e){
    switch (e.type){
        case "change":
        case "create":
        case "mkdir":
        case "delete":
        case "rmdir":
        case "mvfile":
        case "mvdir":
            console.log("file path: " + e.filename);
            console.log("[optional] origin MD5: " + e.oid);
            console.log("[optional] MD5 now: " + e.nid);
            console.log("[optional] origin file path: " + e.oname);
            break;
    }
})

change log

  1. 0.0.2 add stable mode (using "chokidar") for supporting old version of nodejs(0.8) and OSX(10.7)
npm loves you