| date | 2025-10-28T00:00:00.000Z |
|---|---|
| category | migrations |
| title | Node.js v12 to v14 |
| layout | blog-post |
| author | AugustinMauroy |
This page provides a list of codemods to help you migrate your code from Node.js v12 to v14.
This recipe transforms calls of various now-deprecated node:util log functions into the modern alternative, console.log and console.error:
- DEP0026:
util.print→console.log - DEP0027:
util.puts→console.log - DEP0028:
util.debug→console.error - DEP0029:
util.error→console.error
The source code for this codemod can be found in the util-print-to-console-log directory.
You can find this codemod in the Codemod Registry.
npx codemod run @nodejs/create-require-from-pathconst util = require('node:util');
util.print('Hello world');
util.puts('Hello world');
util.debug('Hello world');
util.error('Hello world');console.log('Hello world');
console.log('Hello world');
console.error('Hello world');
console.error('Hello world');