This recipe transforms usage of the deprecatedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nodejs/userland-migrations/llms.txt
Use this file to discover all available pages before exploring further.
process.assert to the proper node:assert module.
Deprecation
Node.js deprecatedprocess.assert in favor of the dedicated node:assert module.
See DEP0100 for more details.
Usage
Run this codemod with:Before/After
- ESM
- CommonJS
What It Does
- Replaces
process.assert()calls withassert()fromnode:assert - Automatically adds the appropriate import/require statement
- Detects whether your project uses ESM or CommonJS by reading
package.json - Preserves assertion arguments and error messages
Smart Import Detection
This codemod uses thefs capability to read your package.json file and determine if the project uses ES modules or CommonJS. Based on this information, it adds the appropriate import statement:
- If
"type": "module"is present, it adds:import assert from "node:assert"; - Otherwise, it adds:
const assert = require("node:assert");