Skip to content

Commit 96e7a59

Browse files
content(migration): fix typo + improve texting (#8291)
* content(migration): fix typo + improve texting * add richard as author * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> Signed-off-by: Augustin Mauroy <[email protected]> --------- Signed-off-by: Augustin Mauroy <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 7ae8d92 commit 96e7a59

File tree

4 files changed

+17
-39
lines changed

4 files changed

+17
-39
lines changed

apps/site/pages/en/blog/migrations/v12-to-v14.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This page provides a list of codemods to help you migrate your code from Node.js
1818

1919
## `util-print-to-console-log`
2020

21-
This recipe transforms calls of various now-deprecated `node:util` log functions into the modern alternative, `console.log` and `console.error`:
21+
This codemod transforms calls of various now-deprecated `node:util` log functions into the modern alternative, `console.log` and `console.error`:
2222

2323
- [DEP0026](https://nodejs.org/api/deprecations.html#DEP0026): `util.print``console.log`
2424
- [DEP0027](https://nodejs.org/api/deprecations.html#DEP0027): `util.puts``console.log`

apps/site/pages/en/blog/migrations/v14-to-v16.mdx

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,6 @@ if (require.main === 'mod.js') {
7676
}
7777
```
7878

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-
10579
## `rmdir`
10680

10781
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.
@@ -119,6 +93,8 @@ npx codemod run @nodejs/rmdir
11993
### Example:
12094

12195
```js displayName="Before"
96+
const fs = require('node:fs');
97+
12298
// Using fs.rmdir with the recursive option
12399
fs.rmdir(path, { recursive: true }, callback);
124100

@@ -130,6 +106,8 @@ fs.promises.rmdir(path, { recursive: true });
130106
```
131107

132108
```js displayName="After"
109+
const fs = require('node:fs');
110+
133111
// Using fs.rm with recursive and force options
134112
fs.rm(path, { recursive: true, force: true }, callback);
135113

apps/site/pages/en/blog/migrations/v22-to-v24.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ date: '2025-10-28T00:03:00.000Z'
33
category: migrations
44
title: Node.js v22 to v24
55
layout: blog-post
6-
author: AugustinMauroy
6+
author: AugustinMauroy, Richard Lau
77
---
88

99
# 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
6767

6868
## Available Codemods
6969

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:
7171

7272
### `fs-access-mode-constants`
7373

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.
7575

7676
This codemod handles [DEP0176](https://nodejs.org/api/deprecations.html#DEP0176).
7777

@@ -101,15 +101,15 @@ fs.access('/path/to/file', fs.constants.R_OK | fs.constants.W_OK, callback);
101101

102102
### `util-log-to-console-log`
103103

104-
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.
105105

106106
So this codemod handle [DEP0059](https://nodejs.org/api/deprecations.html#DEP0059).
107107

108108
```bash
109109
npx codemod run @nodejs/util-log-to-console-log
110110
```
111111

112-
### Example:
112+
#### Example:
113113

114114
```js displayName="Before"
115115
const util = require('node:util');
@@ -191,7 +191,7 @@ open('file.txt', 'w', (err, fd) => {
191191

192192
### `crypto-rsa-pss-update`
193193

194-
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.
195195

196196
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).
197197

@@ -221,7 +221,7 @@ crypto.generateKeyPair(
221221
```
222222

223223
```js displayName="After"
224-
const crypto = require('crypto');
224+
const crypto = require('node:crypto');
225225

226226
crypto.generateKeyPair(
227227
'rsa-pss',

apps/site/site.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
},
3838
"websiteBadges": {
3939
"index": {
40-
"startDate": "2025-04-01T00:00:00.000Z",
41-
"endDate": "2025-07-01T00:00:00.000Z",
40+
"startDate": "2025-10-30T00:00:00.000Z",
41+
"endDate": "2025-11-15T00:00:00.000Z",
4242
"kind": "default",
43-
"title": "JSConf",
44-
"text": "Get your tickets now!",
45-
"link": "https://events.linuxfoundation.org/jsconf-north-america"
43+
"title": "Discover",
44+
"text": "New migration guides",
45+
"link": "https://nodejs.org/en/blog/migrations"
4646
}
4747
}
4848
}

0 commit comments

Comments
 (0)