Node.js v22 to v24

This page provides a list of codemods to help you migrate your code from Node.js v22 to v24.

fs-access-mode-constants

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.

So this codemod handle DEP0176.

const fs = require('node:fs');

fs.access('/path/to/file', fs.F_OK, callback);
fs.access('/path/to/file', fs.R_OK | fs.W_OK, callback);

util-log-to-console-log

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

So this codemod handle DEP0059.

Example:

const util = require('node:util');

util.log('Hello world');
Temps de Lecture
1 min
Auteur
Contribuer
Éditer cette page
Table des matières
  1. fs-access-mode-constants
  2. util-log-to-console-log
  3. Example: