Skip to content

exitProcess ​

Stops the current process with an optional exit code.

Example ​

ts
import { 
exitProcess
} from "@duplojs/server-utils";
const
shouldTerminate
= false;
if (
shouldTerminate
) {
exitProcess
(1);
} const
hasFatalError
= false;
if (
hasFatalError
) {
exitProcess
();
}

Syntax ​

typescript
function exitProcess(code?: number): void

Parameters ​

  • code (number, optional) : exit status code.

Return value ​

  • void : this function terminates the current process.

See also ​

Released under the MIT license.