Process Management for NodeJS
This module provides advanced facilities for querying and manipulating running processes on macOS and Linux. It does so by integrating with the relevant routines provided by the OS.
⚠️ Windows is not (yet) supported.
- Query whether any process is running, even daemons and non-GUI applications on macOS.
- Connect to a process and be notified when it is done.
- Send a custom signal to a process
- Kill a process
Pull requests are welcome!
#!/usr/bin/env nodeconst pid = Numberprocessesargv2ifconsoleprocessconst myProc = pidmyProc
Connects to the given process indicated by the PID number and waits for it to
exit. NodeJS will be forced to keep running until the process exits or
Process.close() is explicitly called.
Indicates whether the given process is running right now. This value might change even during the same execution context.
Registers a callback to be executed when the process exits.
Stops monitoring the process and allows NodeJS to exit.
Send the given signal to the process.
If no signal is provided, will default to
The code is licensed under the MIT license, which means you may use it in commercial products as long as you retain the copyright information.