> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# deprecated-node-api

> A deprecated Node.js API is used: new Buffer(), url.parse() or fs.exists().

## What it flags

`new Buffer()` (use `Buffer.alloc` or `Buffer.from`), `url.parse()` (use `new URL()`) or `fs.exists()` (use `fs.access` or `existsSync`). The `Buffer` fix applies to literal arguments. The reviewable `url.parse` fix requires an unshadowed global `URL`, a single simple HTTP(S) literal, and a direct read of `href`, `protocol`, `host`, `hostname` or `pathname` whose value URL normalization preserves. Other `url.parse` calls are left for a manual change.

`crypto.createCipher()` and `crypto.createDecipher()` were removed in Node.js 22. The recursive options on `fs.rmdir`, `fs.rmdirSync` and `fs.promises.rmdir` were removed in Node.js 25. The rule also reports runtime imports and re-exports of `node:punycode` and `node:domain`, including literal dynamic imports. Literal calls to Node's `require` can also identify the bare built-in names `punycode` and `domain`. These migrations require manual review. See the [Node.js deprecations reference](https://nodejs.org/api/deprecations.html).

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "deprecated-node-api": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.