Skip to content

Commit

Permalink
Merge pull request #1 from pipobscure/patch-1
Browse files Browse the repository at this point in the history
Retain ref to stop
  • Loading branch information
sunknudsen committed Feb 4, 2021
2 parents ce0fe9a + ceff02e commit 642e9b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 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);
}, 60000);
setTimeout(() => {
stop();
console.log('stopped watching');
}, 3600000);

0 comments on commit 642e9b2

Please sign in to comment.