// A missing file or a missing process: Node reports them as ENOENT and ESRCH. export function isNotFound(error: unknown): boolean { if (!(error instanceof Error) || !("code" in error)) { return false; } return error.code === "ENOENT" || error.code === "ESRCH"; }