This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
When a child process is created, registering it with the SubprocessTerminator will ensure that the child gets terminated when the current process terminates.
export declare class SubprocessTerminator
This works by hooking the current process's events for SIGTERM/SIGINT/exit, and ensuring the child process gets terminated in those cases.
SubprocessTerminator doesn't do anything on Windows, since by default Windows automatically terminates child processes when their parent is terminated.
|(BETA) The recommended options when creating a child process.
|(BETA) Terminate the child process and all of its children.
|(BETA) Registers a child process so that it will be terminated automatically if the current process is terminated.