Console 类


Console 类可用于创建具有可配置输出流的简单记录器,并可使用 require('node:console').Consoleconsole.Console(或它们的解构对应物)访问:

The Console class can be used to create a simple logger with configurable output streams and can be accessed using either require('node:console').Console or console.Console (or their destructured counterparts):

const { Console } = require('node:console');
const { Console } = console;