As per below API doc, Node JS listen for process exit event. https://nodejs.org/api/process.html#process_event_exit
How can Node JS listen for system event? Such as, USB inserted, CAMERA device inserted into system or any custom events emitted by Linux.
Since in Linux "Everything is a file" you can monitor the /dev directory for changes. I use this nodejs inotify binding:
node-inotify - http://c4milo.github.io/node-inotify/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With