# process-exit-as-throw

Rule `node/process-exit-as-throw`. Require that `process.exit()` expressions use the same code path as `throw`

- Source: node
- Technologies: Node.js
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 14.8M weekly downloads of presets that enable it
- Trend: +18.0% last quarter
- Rank: #676 by reach, #1389 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `n/process-exit-as-throw` | yes | no | package `eslint-plugin-n` | [docs](https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/process-exit-as-throw.md) |

## Enable it

### ESLint: `eslint.config.js`

```js
import n from "eslint-plugin-n";

export default [
  {
    plugins: { n },
    rules: {
      "n/process-exit-as-throw": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Node.js recommended](https://lintradar.dev/presets/n-recommended.md) | ESLint | `eslint-plugin-n` | 11 | 10M | +17.8% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [node/no-deprecated-api](https://lintradar.dev/rules/node/no-deprecated-api.md): Disallow deprecated APIs
- [node/no-exports-assign](https://lintradar.dev/rules/node/no-exports-assign.md): Disallow the assignment to `exports`
- [node/no-extraneous-import](https://lintradar.dev/rules/node/no-extraneous-import.md): Disallow `import` declarations which import extraneous modules
- [node/no-process-exit](https://lintradar.dev/rules/node/no-process-exit.md): Disallow the use of `process.exit()`
- [node/hashbang](https://lintradar.dev/rules/node/hashbang.md): Require correct usage of hashbang
- [node/no-extraneous-require](https://lintradar.dev/rules/node/no-extraneous-require.md): Disallow `require()` expressions which import extraneous modules

---

Web page: https://lintradar.dev/rules/node/process-exit-as-throw. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
