Answers for "node js util promisify"

1

node js util promisify

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}`);
}
Posted by: Guest on May-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language