Answers for "promisify"

0

promisify

const util = require('util');
const fs = require('fs');

const stat = util.promisify(fs.stat);
stat('.').then((stats) => {
  // Do something with `stats`
}).catch((error) => {
  // Handle the error.
});
Posted by: Guest on October-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language