Skip to content

Commit ddc4cdb

Browse files
update + improve
1 parent 9310143 commit ddc4cdb

6 files changed

Lines changed: 79 additions & 14 deletions

File tree

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: '2025-09-26T12:00:00.000Z'
2+
date: '2025-10-10T12:00:00.000Z'
33
category: migrations
44
title: Node.js v12 to v14
55
layout: blog-post
@@ -20,10 +20,10 @@ This page provides a list of codemods to help you migrate your code from Node.js
2020

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

23-
- ([DEP0026](https://nodejs.org/api/deprecations.html#DEP0026)) [`util.print`](https://nodejs.org/api/util.html#util_util_print) - `console.log`
24-
- ([DEP0027](https://nodejs.org/api/deprecations.html#DEP0027)) [`util.puts`](https://nodejs.org/api/util.html#util_util_puts) - `console.log`
25-
- ([DEP0028](https://nodejs.org/api/deprecations.html#DEP0028)) [`util.debug`](https://nodejs.org/api/util.html#util_util_debug) - `console.error`
26-
- ([DEP0029](https://nodejs.org/api/deprecations.html#DEP0029)) [`util.error`](https://nodejs.org/api/util.html#util_util_error) - `console.error`
23+
- [DEP0026](https://nodejs.org/api/deprecations.html#DEP0026): `util.print` `console.log`
24+
- [DEP0027](https://nodejs.org/api/deprecations.html#DEP0027): `util.puts` `console.log`
25+
- [DEP0028](https://nodejs.org/api/deprecations.html#DEP0028): `util.debug` `console.error`
26+
- [DEP0029](https://nodejs.org/api/deprecations.html#DEP0029): `util.error` `console.error`
2727

2828
```bash
2929
npx codemod run @nodejs/create-require-from-path
@@ -46,3 +46,11 @@ console.log('Hello world');
4646
console.error('Hello world');
4747
console.error('Hello world');
4848
```
49+
50+
### Source Code
51+
52+
The source code for this codemod can be found in the [util-print-to-console-log directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/util-print-to-console-log).
53+
54+
### Registry Link
55+
56+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/util-print-to-console-log).

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

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: '2025-09-26T12:00:00.000Z'
2+
date: '2025-10-10T12:00:00.000Z'
33
category: migrations
44
title: Node.js v14 to v16
55
layout: blog-post
@@ -8,10 +8,11 @@ author: AugustinMauroy
88

99
# Node.js v14 to v16
1010

11-
<AlertBox
12-
level="warning"
13-
title="This article cover a part of the migration from Node.js v14 to v16. The userland migrations team is working on more codemods to help you with the migration."
14-
/>
11+
<AlertBox level="warning" title="!">
12+
This article cover a part of the migration from Node.js v14 to v16. The
13+
userland migrations team is working on more codemods to help you with the
14+
migration.
15+
</AlertBox>
1516

1617
This page provides a list of codemods to help you migrate your code from Node.js v14 to v16.
1718

@@ -39,6 +40,14 @@ const require = createRequire('/path/to/module');
3940
const myModule = require('./myModule.cjs');
4041
```
4142

43+
### Source Code
44+
45+
The source code for this codemod can be found in the [create-require-from-path directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/create-require-from-path).
46+
47+
### Registry Link
48+
49+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/create-require-from-path).
50+
4251
## `process-main-module`
4352

4453
The `process.mainModule` property was deprecated in favor of `require.main`. This codemod will help you replace the old `process.mainModule` usage with the new `require.main` usage.
@@ -67,6 +76,14 @@ if (require.main === 'mod.js') {
6776
}
6877
```
6978

79+
### Source Code
80+
81+
The source code for this codemod can be found in the [process-main-module directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/process-main-module).
82+
83+
### Registry Link
84+
85+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/process-main-module).
86+
7087
## `process-mainModule-to-require-main`
7188

7289
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.
@@ -123,6 +140,14 @@ fs.rmSync(path, { recursive: true, force: true });
123140
fs.promises.rm(path, { recursive: true, force: true });
124141
```
125142

143+
### Source Code
144+
145+
The source code for this codemod can be found in the [rmdir directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/rmdir).
146+
147+
### Registry Link
148+
149+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/rmdir).
150+
126151
## `tmpDir-to-tmpdir`
127152

128153
The `tmpDir` function was renamed to `tmpdir` in Node.js v16. This codemod will help you replace all instances of `tmpDir` with `tmpdir`.
@@ -146,3 +171,11 @@ import { tmpdir } from 'node:os';
146171

147172
const foo = tmpdir();
148173
```
174+
175+
### Source Code
176+
177+
The source code for this codemod can be found in the [tmpdir-to-tmpdir directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/tmpdir-to-tmpdir).
178+
179+
### Registry Link
180+
181+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/tmpDir-to-tmpdir).

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: '2025-09-26T12:00:00.000Z'
2+
date: '2025-10-10T12:00:00.000Z'
33
category: migrations
44
title: Node.js v20 to v22
55
layout: blog-post
@@ -37,3 +37,11 @@ import jsonData from './data.json' assert { type: 'json' };
3737
```js displayName="After"
3838
import jsonData from './data.json' with { type: 'json' };
3939
```
40+
41+
### Source Code
42+
43+
The source code for this codemod can be found in the [import-assertions-to-attributes directory](https://github.com/nodejs/userland-migrations/tree/main/recipes/import-assertions-to-attributes).
44+
45+
### Registry Link
46+
47+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/import-assertions-to-attributes).

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
date: '2025-09-26T12:00:00.000Z'
2+
date: '2025-10-10T12:00:00.000Z'
33
category: migrations
44
title: Node.js v22 to v24
55
layout: blog-post
@@ -157,3 +157,11 @@ crypto.generateKeyPair(
157157
}
158158
);
159159
```
160+
161+
### Source Code
162+
163+
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).
164+
165+
### Registry Link
166+
167+
You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/crypto-rsa-pss-update).

apps/site/pages/en/learn/getting-started/userland-migrations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ npx codemod @nodejs/import-assertions-to-attributes
4242
The [Codemod registry](https://codemod.link/nodejs-official) provides a list of available codemods for Node.js.
4343
Some codemods may not be included in the following resources but are still available because they are not related to a specific migration to a Node.js version. Since we only list codemods for EoL deprecations, you may need to explore the registry for other codemods that could be useful for your migrations.
4444

45+
> Please note that if you are logged into the Codemod platform, you can like these posts. This shows us that our work is valuable.
46+
4547
## Feedback
4648

4749
If you have any feedback or suggestions for improvements, please open an issue on the [Node.js Userland Migrations repository](https://github.com/nodejs/userland-migrations/issues).
@@ -55,3 +57,9 @@ This board tracks:
5557
- Codemod kind (deprecation, breaking change, ecosystem)
5658
- Node.js version
5759
- Status (backlog, todo, in progress, done, not planned) _If you want to contribute, please check the "todo" column_
60+
61+
## Migrations guides
62+
63+
You can find all migrations guide on the [migration guides section](/blog/migrations).
64+
65+
Please also note that migration guides for major-major releases only contain end-of-life [deprecations](https://nodejs.org/docs/latest/api/deprecations.html) and breaking changes.

packages/i18n/src/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
},
299299
"blog": {
300300
"blogHeader": {
301-
"subtitle": "The latest Node.js news, case studies, tutorials, and resources.",
301+
"subtitle": "The latest Node.js news, migrations guides and events summaries",
302302
"rssLink": "RSS feed"
303303
}
304304
}
@@ -329,7 +329,7 @@
329329
"video": "Video",
330330
"weekly": "Weekly Updates",
331331
"wg": "Working Groups",
332-
"migrations": "Migrations guides",
332+
"migrations": "Migrations Guides",
333333
"events": "Events"
334334
}
335335
},

0 commit comments

Comments
 (0)