Created
June 4, 2019 14:18
-
-
Save AliSawari/aa2151994d72afa00f06c4af23357a1c to your computer and use it in GitHub Desktop.
example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { readFile } = require('fs') | |
const { promisify } = require('util') | |
const readFilePromise = promisify(readFile) | |
readFilePromise('myFile').then(data => { | |
console.log(data.toString()) | |
}).catch(e => console.log(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment