Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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}`);
}
Source by nodejs.org #
 
PREVIOUS NEXT
Tagged: #node #js #util #promisify
ADD COMMENT
Topic
Name
8+8 =