# prefer-process-get-builtin-module

Rule `node/prefer-process-get-builtin-module`. Enforce using `process.getBuiltinModule()` to load Node.js built-in modules

- Source: node
- Technologies: Node.js
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 413K weekly downloads of presets that enable it
- Trend: −5.0% last quarter
- Rank: #1621 by reach, #1632 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
const fs = require("node:fs")
const promises = await import("node:fs/promises")
```

### Correct: the rule accepts this

```js
const fs = process.getBuiltinModule("node:fs")
const eslint = require("eslint")
const lazyFs = import("node:fs")
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { n },
    rules: {
      "n/prefer-process-get-builtin-module": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [node/no-unpublished-bin](https://lintradar.dev/rules/node/no-unpublished-bin.md): Disallow `bin` files that npm ignores
- [node/file-extension-in-import](https://lintradar.dev/rules/node/file-extension-in-import.md): Enforce the style of file extensions in `import` declarations
- [node/no-process-env](https://lintradar.dev/rules/node/no-process-env.md): Disallow the use of `process.env`
- [node/no-sync](https://lintradar.dev/rules/node/no-sync.md): Disallow synchronous methods
- [node/exports-style](https://lintradar.dev/rules/node/exports-style.md): Enforce either `module.exports` or `exports`
- [node/callback-return](https://lintradar.dev/rules/node/callback-return.md): Require `return` statements after callbacks

---

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