Skip to content

Commit e06e67c

Browse files
committed
Add file watch example
1 parent ea8beae commit e06e67c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

JavaScript/6-watch.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
5+
const watch = (path) => {
6+
const watcher = fs.watch(path, (event, file) => {
7+
console.dir({ event, file });
8+
});
9+
};
10+
11+
watch('./');

0 commit comments

Comments
 (0)