promisify-core-api
Version:
A Polyfill for Promisify Node ^8.0.0 Core Api
17 lines (13 loc) • 411 B
JavaScript
const functions = require('.');
console.log(functions);
// use-case :3
const path = require('path');
const fs = require('fs');
// then
fs.readFileAsync(path.join(__filename))
.then(txt => console.log(txt.toString()))
.catch(err => console.log(err));
// catch
fs.readFileAsync(path.join(__dirname, __dirname))
.then(txt => console.log(txt.toString()))
.catch(err => console.log(err));