Skip to content

Commit c02920f

Browse files
doc: add automated migration info to deprecations
1 parent ce72fcc commit c02920f

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

doc/api/deprecations.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,12 @@ Type: End-of-Life
551551
The `os.tmpDir()` API was deprecated in Node.js 7.0.0 and has since been
552552
removed. Please use [`os.tmpdir()`][] instead.
553553

554+
If you want an automated way to update your code you can use this codemod:
555+
556+
```bash
557+
npx codemod@latest @nodejs/tmpDir-to-tmpdir
558+
```
559+
554560
### DEP0023: `os.getNetworkInterfaces()`
555561

556562
<!-- YAML
@@ -628,6 +634,12 @@ Type: End-of-Life
628634

629635
`util.print()` has been removed. Please use [`console.log()`][] instead.
630636

637+
If you want an automated way to update you can use this codemod:
638+
639+
```bash
640+
npx codemod@latest @nodejs/util-print-to-console-log
641+
```
642+
631643
### DEP0027: `util.puts()`
632644

633645
<!-- YAML
@@ -649,6 +661,12 @@ Type: End-of-Life
649661

650662
`util.puts()` has been removed. Please use [`console.log()`][] instead.
651663

664+
If you want an automated way to update you can use this codemod:
665+
666+
```bash
667+
npx codemod@latest @nodejs/util-print-to-console-log
668+
```
669+
652670
### DEP0028: `util.debug()`
653671

654672
<!-- YAML
@@ -670,6 +688,10 @@ Type: End-of-Life
670688

671689
`util.debug()` has been removed. Please use [`console.error()`][] instead.
672690

691+
```bash
692+
npx codemod@latest @nodejs/util-debug-to-console-error
693+
```
694+
673695
### DEP0029: `util.error()`
674696

675697
<!-- YAML
@@ -691,6 +713,12 @@ Type: End-of-Life
691713

692714
`util.error()` has been removed. Please use [`console.error()`][] instead.
693715

716+
If you want an automated way to update you can use this codemod:
717+
718+
```bash
719+
npx codemod@latest @nodejs/util-print-to-console-log
720+
```
721+
694722
### DEP0030: `SlowBuffer`
695723

696724
<!-- YAML
@@ -1416,6 +1444,12 @@ By adopting one of these alternatives, you can transition away from `util.log()`
14161444
and choose a logging strategy that aligns with the specific
14171445
requirements and complexity of your application.
14181446

1447+
If you want an automated way to update you can use this codemod:
1448+
1449+
```bash
1450+
npx codemod@latest @nodejs/util-log-to-console-log
1451+
```
1452+
14191453
### DEP0060: `util._extend()`
14201454

14211455
<!-- YAML
@@ -2754,6 +2788,12 @@ Type: End-of-Life
27542788

27552789
Use [`module.createRequire()`][] instead.
27562790

2791+
If you want an automated way to update your code you can use this codemod:
2792+
2793+
```bash
2794+
npx codemod@latest @nodejs/create-require-from-path
2795+
```
2796+
27572797
### DEP0131: Legacy HTTP parser
27582798

27592799
<!-- YAML
@@ -2915,6 +2955,12 @@ modules is unsupported.
29152955
It is deprecated in favor of [`require.main`][], because it serves the same
29162956
purpose and is only available on CommonJS environment.
29172957

2958+
If you want an automated way to update you can use this codemod:
2959+
2960+
```bash
2961+
npx codemod@latest @nodejs/process-main-module
2962+
```
2963+
29182964
### DEP0139: `process.umask()` with no arguments
29192965

29202966
<!-- YAML
@@ -3085,6 +3131,12 @@ Use `fs.rm(path, { recursive: true, force: true })`,
30853131
`fs.rmSync(path, { recursive: true, force: true })` or
30863132
`fs.promises.rm(path, { recursive: true, force: true })` instead.
30873133

3134+
If you want an automated way to update you can use this codemod:
3135+
3136+
```bash
3137+
npx codemod@latest @nodejs/rmdir
3138+
```
3139+
30883140
### DEP0148: Folder mappings in `"exports"` (trailing `"/"`)
30893141

30903142
<!-- YAML
@@ -3686,6 +3738,12 @@ Type: End-of-Life
36863738
`F_OK`, `R_OK`, `W_OK` and `X_OK` getters exposed directly on `node:fs` were
36873739
removed. Get them from `fs.constants` or `fs.promises.constants` instead.
36883740

3741+
If you want an automated way to update your code you can use this codemod:
3742+
3743+
```bash
3744+
npx codemod@latest @nodejs/fs-access-mode-constants
3745+
```
3746+
36893747
### DEP0177: `util.types.isWebAssemblyCompiledModule`
36903748

36913749
<!-- YAML
@@ -4031,6 +4089,12 @@ Instantiating classes without the `new` qualifier exported by the `node:http` mo
40314089
It is recommended to use the `new` qualifier instead. This applies to all http classes, such as
40324090
`OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`.
40334091

4092+
If you want to update your code automatically you can use this codemod:
4093+
4094+
```bash
4095+
npx codemod@latest @nodejs/http-classes-with-new
4096+
```
4097+
40344098
### DEP0196: Calling `node:child_process` functions with `options.shell` as an empty string
40354099

40364100
<!-- YAML
@@ -4070,6 +4134,12 @@ Type: Documentation-only
40704134

40714135
The [`util.types.isNativeError`][] API is deprecated. Please use [`Error.isError`][] instead.
40724136

4137+
If you want an automated way to update you can use this codemod:
4138+
4139+
```bash
4140+
npx codemod@latest @nodejs/types-is-native-error
4141+
```
4142+
40734143
### DEP0198: Creating SHAKE-128 and SHAKE-256 digests without an explicit `options.outputLength`
40744144

40754145
<!-- YAML

0 commit comments

Comments
 (0)