DEV Community

Discussion on: Create Your Own Live Browser Refresh In Deno

Collapse
 
desibabe profile image
Desibabe

Awesome. I am writing code for EDI invoices and I am using DENO watchFs as well. My code works fine for single incoming file processing and it works great, however, when multiple incoming files arrive at the same time the program crashes. I have to process further windows batch files to do the conversion and takes about 30 seconds. How do we achieve this.

for await (const event of watcher) {
if (event.kind === "create" {
console.log(New File: ${event.paths[0]});
// proccess windows command
processEDI(event.paths[0]);
};
}

Thanks.