-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
33 lines (28 loc) · 953 Bytes
/
main.js
File metadata and controls
33 lines (28 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const addon = require("./build/Release/watcher");
const path = require("path");
function handleFolderChanges(changeInfo) {
const { fileName, changeType } = changeInfo;
switch (changeType) {
case "ADDED":
console.log(`El archivo ${fileName} fue agregado.`);
break;
case "DELETED":
console.log(`El archivo ${fileName} fue eliminado.`);
break;
case "MODIFIED":
console.log(`El archivo ${fileName} fue modificado.`);
break;
default:
}
}
console.log(`Iniciando...`);
process.on("unhandledRejection", (reason, p) => {
console.error("Unhandled Rejection at:", p, "reason:", reason);
});
const folderPath = path.join(__dirname, "test");
// addon.startWatching(folderPath, handleFolderChanges);
console.log("Presiona Ctrl + C para detener el script.");
process.stdin.resume();
process.on("unhandledRejection", (reason, p) => {
console.error("Unhandled Rejection at:", p, "reason:", reason);
});