util.print, util.puts, util.debug, util.error DEP0026,DEP0027,DEP0028,DEP0029
This recipe transforms the usage of log functions from util, print, puts, debug, error to use console.log() or console.error().
See DEP0026.
See DEP0027.
See DEP0028.
See DEP0029.
Example
diff- const util = require("node:util"); - util.print("Hello world"); + console.log("Hello world"); - util.puts("Hello world"); + console.log("Hello world"); - util.debug("Hello world"); + console.error("Hello world"); - util.error("Hello world"); + console.error("Hello world");
Before:
jsconst { print, error } = require("node:util"); print("Application started"); error("Processing request");
After:
jsconsole.log("Application started"); console.error("Processing request");