diff --git a/index.js b/index.js index 4fe1d29..00c3cf0 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,12 @@ const fsevents = require('fsevents'); -fsevents.watch(`${__dirname}/watched`, (path, flags, id) => { +const stop = fsevents.watch(`${__dirname}/watched`, (path, flags, id) => { const info = fsevents.getInfo(path, flags, id); console.log(info) }); setInterval(() => { console.log("tick") -}, 60000); \ No newline at end of file +}, 60000); +setTimeout(() => { + stop(); + console.log('stopped watching'); +}, 3600000);