UNPKG

watch-project

Version:

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

32 lines (26 loc) 714 B
### Installation ```bash npm install watch-project ``` ### Usage ```js 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)