You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/site/pages/en/blog/migrations/v14-to-v16.mdx
+4-26Lines changed: 4 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,32 +76,6 @@ if (require.main === 'mod.js') {
76
76
}
77
77
```
78
78
79
-
## `process-mainModule-to-require-main`
80
-
81
-
The [`process.mainModule`](https://nodejs.org/api/process.html#process_process_mainmodule) property was deprecated ([DEP0144](https://nodejs.org/api/deprecations.html#DEP0144)) in favor of [`require.main`](https://nodejs.org/api/modules.html#modules_accessing_the_main_module). This codemod replaces calls of the deprecated property with the modern alternative mentioned.
82
-
83
-
The source code for this codemod can be found in the [process-mainModule-to-require-main directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/process-main-module).
84
-
85
-
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/process-mainModule-to-require-main).
86
-
87
-
```bash
88
-
npx codemod run @nodejs/process-mainModule-to-require-main
89
-
```
90
-
91
-
### Example:
92
-
93
-
```js displayName="Before"
94
-
if (process.mainModule) {
95
-
console.log('This script is the main module');
96
-
}
97
-
```
98
-
99
-
```js displayName="After"
100
-
if (require.main===module) {
101
-
console.log('This script is the main module');
102
-
}
103
-
```
104
-
105
79
## `rmdir`
106
80
107
81
The `fs.rmdir` function was deprecated in favor of `fs.rm` with the `{ recursive: true }` option. This codemod will help you replace the old `fs.rmdir` function with the new `fs.rm` function.
Copy file name to clipboardExpand all lines: apps/site/pages/en/blog/migrations/v22-to-v24.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ date: '2025-10-28T00:03:00.000Z'
3
3
category: migrations
4
4
title: Node.js v22 to v24
5
5
layout: blog-post
6
-
author: AugustinMauroy
6
+
author: AugustinMauroy, Richard Lau
7
7
---
8
8
9
9
# Node.js v22 to v24
@@ -67,11 +67,11 @@ Node.js' `configure` script will warn if you attempt to build Node.js with a com
67
67
68
68
## Available Codemods
69
69
70
-
Some breaking changes or End of Life deprecations in Node.js 23 and 24 have associated codemods to help you update your codebase. Below is a list of the available codemods for this migration:
70
+
Some breaking changes or End of Life (EOL) deprecations in Node.js 23 and 24 have associated codemods to help you update your codebase. Below is a list of the available codemods for this migration:
71
71
72
72
### `fs-access-mode-constants`
73
73
74
-
In Node.js 24, the`fs` module introduced a runtime deprecation for `F_OK`, `R_OK`, `W_OK`, and `X_OK` getters exposed directly on `node:fs`. Get them from `fs.constants` or `fs.promises.constants` instead.
74
+
The`fs` module introduced a runtime deprecation for `F_OK`, `R_OK`, `W_OK`, and `X_OK` getters exposed directly on `node:fs`. Get them from `fs.constants` or `fs.promises.constants` instead.
75
75
76
76
This codemod handles [DEP0176](https://nodejs.org/api/deprecations.html#DEP0176).
In Node.js v23, the `util.log` function was deprecated in favor of using `console.log` directly. Because it's an unmaintained legacy API that was exposed to user land by accident
104
+
The `util.log` function was deprecated in favor of using `console.log` directly, because it's an unmaintained legacy API that was exposed to user land by accident.
105
105
106
106
So this codemod handle [DEP0059](https://nodejs.org/api/deprecations.html#DEP0059).
Codemod to handle Node.js crypto deprecation [DEP0154](https://nodejs.org/docs/latest/api/deprecations.html#DEP0154) by transforming deprecated RSA-PSS key generation options.
194
+
In [DEP0154](https://nodejs.org/docs/latest/api/deprecations.html#DEP0154), the `generateKeyPair` and `generateKeyPairSync` methods in the `crypto` module deprecated the `hash`, `mgf1Hash`, and `saltLength` options for the `'rsa-pss'` key type in favor of `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` respectively.
195
195
196
196
The source code for this codemod can be found in the [crypto-rsa-pss-update directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/crypto-rsa-pss-update).
0 commit comments