Vahan
Vahan

Reputation: 58

How to add event listener on folder in Electronjs

I'm trying to detect changes in folder for example when I create/update something in specified folder, I need to see that in console of my electron app, so the question is how to show in console every changes in folder and when I click on any file, how to detect on which file I clicked, is it possible with electronjs/nodejs

Upvotes: 2

Views: 1167

Answers (1)

Taxel
Taxel

Reputation: 4207

this article compares the chokidar module with the node.js builtins fs.watch() and fs.watchFile() and comes to the conclusion that chokidar is the way to go. So there's your alternatives for implementing this feature.

This does not handle clicking on files though (you mean in the file explorer, not in your app, right?) which is not possible afaik.

Upvotes: 1

Related Questions