node package manager

watch-project

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)