简体   繁体   中英

How to add event listener on folder in Electronjs

我正在尝试检测文件夹中的更改,例如当我在指定文件夹中创建/更新某些内容时,我需要在我的电子应用程序的控制台中看到它,所以问题是如何在控制台中显示文件夹中的每个更改以及何时单击在任何文件上,如何检测我单击了哪个文件,是否可以使用electronjs/nodejs

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM