Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- // node --experimental-modules index.mjs
- import fs from 'fs';
- import util from 'util';
- const readFile = util.promisify(fs.readFile);
- const fnThen = (result) => {
- console.log('result', result.toString());
- }
- const fnCatch = (error) => {
- console.log('error', error);
- }
- readFile('./package.json')
- .then(fnThen)
- .catch(fnCatch);
Add Comment
Please, Sign In to add comment