{"bugs":{"url":"https://github.com/jorritd/node-watch/issues"},"dist":{"shasum":"d6e4adbaa4825545612c6aecb98adff2c7d0811e","tarball":"https://registry.npmjs.org/nodewatch/-/nodewatch-0.3.1.tgz","integrity":"sha512-CUUSAVWoM0p40LmsC4xQfrTJ92hOc+P9FEfURYad/IFkvjlB2yznzA3a/kEZR3t/wF21TYDIcJWZ8RN/bFsxAg==","signatures":[{"sig":"MEUCIQDK7Ncm2j7uHhXFm894j+ebT+ftF4hLVsekz7e7XqXZEAIgcrWF7pDPXGEI9GOz4szgMgUgmijf6tVDefrN5MZwS64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/watch.js","name":"nodewatch","author":{"name":"Jorrit Duin","email":"jorrit.duin@gmail.com"},"readme":"# node-watch\n\nSimple utility for nodejs to watch file changes.\n\nA file change is:\n\n* a **file** whom's mtime is changed\n* a **file** which is added to a 'watched' folder\n* a **file** which is deleted form a 'watched' folder\n\nA new feature is to watch folders recurively.\nHowever, polling for changes on the file system is slow.\nAnd I did not test this module on a large number of files and\nnested folders.\n\n\nThis utility is handy for e.g. automatic testing in combination with a testing frame-work,\nAn example lives within the JakeFile (jake and docco required)\n\n    run: jake autotest\n\nMake changes in the src/watch.js file or the specs/watchSpec.js file and see te specs running automaticly\n\n## Install:\n\n     npm install nodewatch\n     \n(Use the \"-g\" global switch for installing nodewatch global)\n\n## Usage:\n\n\n     var watch = require('nodewatch');\n     // Adding 2 dirs relative from process.cwd()\n     // Nested dirs are not watched\n     // dirs can also be added absolute\n     watch.add(\"./spec\").add(\"./lib/watch\").onChange(function(file,prev,curr,action){\n        console.log(file);\n        console.log(prev.mtime.getTime());\n        console.log(curr.mtime.getTime());\n        console.log(action) // new, change, delete\n\n     });\n     \n     // Clear (remove) the listeners\n     watch.clearListeners();\n     \n     // Remove dirs to watch\n     watch.remove(\"./spec\").remdDir(\"./lib/watch\");\n \n\n## Methods:\n\n\n     // Add a dir or file relative from process.cwd()\n     watch.add(\"./specs\");\n     // or\n     watch.add(\"../specs\");\n     // or\n     watch.add(\"../specs\",true);\n     // With the last argument = true, the specs folder\n     // is recursive watched.\n\n     // Just watch ONE file\n     watch.add(\"../path/to/my/file.js\")\n     // Add a dir absolute \n     watch.add(\"/absolute/path\");\n     \n     // Set a listener\n     // It will provide a file (filename as string), prev and curr stats objects\n     watch.onChange(function(file,prev,curr,action){\n            console.log(file);\n            console.log(prev.mtime.getTime());\n            console.log(curr.mtime.getTime());\n            console.log(action); // new, change, delete\n      });\n     \n     // Remove a dir or file (absolute or relative)\n     watch.remove(\"./spec\");\n     \n     // Clear the listener(s) attached via onChange();\n     watch.clearListeners();\n\n\n\n","engines":{"node":">=0.4.0"},"_npmUser":{"name":"jorrit","email":"jorrit.duin@gmail.com"},"homepage":"http://jorritd.github.com/node-watch/","keywords":["watch","tdd","change","filechange"],"licenses":[{"url":"http://www.gnu.org/licenses","type":"GNU General Public License"}],"deprecated":"Obsolete","repository":{"url":"git://github.com/jorritd/node-watch.git","type":"git"},"_npmVersion":"1.1.59","description":"Simple utility to watch file changes. A file change is a file whom's mtime is changed","directories":{"lib":"./lib","docs":"./docs"},"maintainers":[{"name":"jorrit","email":"jorrit.duin@gmail.com"}],"devDependencies":{"jake":"0.2.15","docco":"0.3.0","nodewatch":"0.1.0","uglify-js":"1.2.5","jasmine-node":"1.0.20"},"_id":"nodewatch@0.3.1","version":"0.3.1"}