打印到终端

  1. process.stdout.write(Date.now() + '\r’);
  2. fs.writeSync(1, '123’);

// 当命令解释程序(即shell)运行一个程序的时候,它将打开三个"文件",对应当文件描述符分别为0,1,2,依次表示标准输入、标准输出、标准错误

// console,.log 是异步操作,在 AsyncHooks 中使用会造成无限循环
This will print to stdout because 1 is the file descriptor for stdout and will not invoke AsyncHooks recursively because it is synchronous.