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

npm install watch-project
1 downloads in the last week
34 downloads in the last month


npm install watch-project


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);

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