Answer the question
In order to leave comments, you need to log in
How to make fs watch in node.js watch files in subfolders?
node.js documentation has this example:
fs.watch('./', { encoding: 'utf8' }, (eventType, filename) => {
if (filename) {
console.log(filename);
}
});
Answer the question
In order to leave comments, you need to log in
https://nodejs.org/docs/latest/api/fs.html#fs_fs_w...
fs.watch('./', { encoding: 'utf8', recursive: true }, (eventType, filename) => {
if (filename) {
console.log(filename);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question