Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block7.js Secret

Last active February 21, 2018 14:55
Show Gist options
  • Save kepta/fc70a86ffe573576448884e1c26ca8fa to your computer and use it in GitHub Desktop.
Save kepta/fc70a86ffe573576448884e1c26ca8fa to your computer and use it in GitHub Desktop.
const {promisify} = require('util');
const fs = require('fs');
const readFileAsync = promisify(fs.readFile);
readFileAsync('myfile.txt', 'utf-8')
.then(r => console.log(r))
.catch(e => console.error(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment