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): voidParameters
code(number, optional) : exit status code.
Return value
void: this function terminates the current process.
See also
getProcessArguments- Returns command-line arguments.environmentVariable- Loads and validates environment variables.
