Node JS - 监听系统事件
Node JS - listen for system events
根据下面的 API 文档,Node JS 监听进程退出事件。
https://nodejs.org/api/process.html#process_event_exit
Node JS 如何监听系统事件?例如,USB 已插入、CAMERA 设备已插入系统或 Linux.
发出的任何自定义事件
因为在 Linux "Everything is a file" 中,您可以监视 /dev 目录的更改。我使用这个 nodejs inotify 绑定:
node-inotify - http://c4milo.github.io/node-inotify/
根据下面的 API 文档,Node JS 监听进程退出事件。 https://nodejs.org/api/process.html#process_event_exit
Node JS 如何监听系统事件?例如,USB 已插入、CAMERA 设备已插入系统或 Linux.
发出的任何自定义事件因为在 Linux "Everything is a file" 中,您可以监视 /dev 目录的更改。我使用这个 nodejs inotify 绑定:
node-inotify - http://c4milo.github.io/node-inotify/