nodejs-codemods-bundle
Official Node.js codemod bundle for planning and orchestrating modernization across large production codebases. Runs all @nodejs registry transforms to power Codemod Insights dashboards.
# nodejs-codemods-bundle
A codemod bundle containing all the official Node.js codemods for planning and orchestrating modernization
across large production codebases. Runs **29** `@nodejs` registry transforms
in one pass to power Codemod Insights dashboards.
Five packages are temporarily excluded until they are republished with inlined
`@nodejs/codemod-utils` (bare imports fail at CLI runtime):
`http-classes-with-new`, `process-main-module`, `rmdir`, `tmpDir-to-tmpdir`,
and `util-log-to-console-log`.
Click **Apply to repo** to start building customizable Insight dashboards with
Codemod AI.
## Bundled codemods
| Step | Package | Description |
| ---- | -------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| 1 | `@nodejs/axios-to-whatwg-fetch` | Replace `axios` with `fetch` |
| 2 | `@nodejs/buffer-atob-btoa` | Migrate legacy `buffer.atob()` / `buffer.btoa()` to the current APIs |
| 3 | `@nodejs/chalk-to-util-styletext` | Migrate from `chalk` to Node.js `util.styleText` |
| 4 | `@nodejs/create-require-from-path` | DEP0130: `createRequireFromPath` → `createRequire` |
| 5 | `@nodejs/createCredentials-to-createSecureContext` | DEP0010: `crypto.createCredentials` → `tls.createSecureContext` |
| 6 | `@nodejs/crypto-createcipheriv-migration` | Replace removed `createCipher` / `createDecipher` with `createCipheriv` / `createDecipheriv` |
| 7 | `@nodejs/crypto-fips-to-getFips` | DEP0093: `crypto.fips` → `crypto.getFips()` / `crypto.setFips()` |
| 8 | `@nodejs/crypto-rsa-pss-update` | DEP0154: RSA-PSS `hash` → `hashAlgorithm` options |
| 9 | `@nodejs/dirent-path-to-parent-path` | DEP0178: `dirent.path` → `dirent.parentPath` |
| 10 | `@nodejs/err-invalid-callback` | DEP0159: `ERR_INVALID_CALLBACK` → `ERR_INVALID_ARG_TYPE` |
| 11 | `@nodejs/fs-access-mode-constants` | DEP0176: migrate `fs.F_OK` / `R_OK` / `W_OK` / `X_OK` imports |
| 12 | `@nodejs/fs-truncate-fd-deprecation` | DEP0081: `truncate` → `ftruncateSync` when using a file descriptor |
| 13 | `@nodejs/http-classes-with-new` _(temporarily disabled)_ | DEP0195: instantiate `node:http` classes with `new` |
| 14 | `@nodejs/http-outgoingmessage-headers` | DEP0066: migrate deprecated `OutgoingMessage` `_headers` / `_headerNames` |
| 15 | `@nodejs/http2-priority-signaling` | DEP0194: remove HTTP/2 priority-related options and methods |
| 16 | `@nodejs/import-assertions-to-attributes` | Replace `assert` import attributes with `with` |
| 17 | `@nodejs/mocha-to-node-test-runner` | Migrate Mocha 8.x tests to the Node.js test runner |
| 18 | `@nodejs/mock-module-exports` | Handle `mock.module` exports deprecation |
| 19 | `@nodejs/node-url-to-whatwg-url` | DEP0116: `url.parse` → `new URL()` |
| 20 | `@nodejs/process-assert-to-node-assert` | DEP0100: `process.assert` → `node:assert` |
| 21 | `@nodejs/process-main-module` _(temporarily disabled)_ | DEP0138: `process.mainModule` → `require.main` |
| 22 | `@nodejs/repl-builtin-modules` | DEP0191: `repl.builtinModules` → `module.builtinModules` |
| 23 | `@nodejs/repl-classes-with-new` | DEP0185: instantiate `node:repl` classes with `new` |
| 24 | `@nodejs/rmdir` _(temporarily disabled)_ | DEP0147: `fs.rmdir` → `fs.rm` |
| 25 | `@nodejs/slow-buffer-to-buffer-alloc-unsafe-slow` | DEP0030: `SlowBuffer` → `Buffer.allocUnsafeSlow()` |
| 26 | `@nodejs/timers-deprecations` | Migrate deprecated `node:timers` APIs to public timer functions |
| 27 | `@nodejs/tls-create-secure-pair-to-tls-socket` | DEP0064: `createSecurePair` → `TLSSocket` |
| 28 | `@nodejs/tmpDir-to-tmpdir` _(temporarily disabled)_ | DEP0022: `tmpDir` → `tmpdir` |
| 29 | `@nodejs/types-is-native-error` | DEP0197: `types.isNativeError` → `Error.isError` |
| 30 | `@nodejs/util-extend-to-object-assign` | DEP0060: `util._extend()` → `Object.assign()` |
| 31 | `@nodejs/util-is` | Replace deprecated `util.is*()` methods with modern equivalents |
| 32 | `@nodejs/util-log-to-console-log` _(temporarily disabled)_ | DEP0059: `util.log()` → `console.log()` |
| 33 | `@nodejs/util-print-to-console-log` | DEP0026–DEP0029: `util.print` / `puts` / `debug` / `error` → `console` |
| 34 | `@nodejs/zlib-bytesread-to-byteswritten` | DEP0108: `zlib.bytesRead` → `zlib.bytesWritten` |