How do I make Deno run code when it is closed out on Windows
According to the documentation there is Deno.addSignalListener but it only handles on Windows when you use CTRL+C or CTRL+BREAK, how do I make it handle all possible closes like Deno.exit or closing it from the task bar?
1 Reply
There is deno unload/beforeunload event but it doesn't seem to work when using CTRL+C or when closing out the window, only when I use deno.exit (and I assume also when the script ends naturally)
nodejs' process.on('exit') doesn't seem to really do anything for me on deno