📜  node js util promisify - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:11.843000             🧑  作者: Mango

代码示例1
const util = require('util');
const fs = require('fs');

const stat = util.promisify(fs.stat);

async function callStat() {
  const stats = await stat('.');
  console.log(`This directory is owned by ${stats.uid}`);
}