Skip to content

Instantly share code, notes, and snippets.

@AliSawari
Created June 4, 2019 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AliSawari/aa2151994d72afa00f06c4af23357a1c to your computer and use it in GitHub Desktop.
Save AliSawari/aa2151994d72afa00f06c4af23357a1c to your computer and use it in GitHub Desktop.
example
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