Skip to content

Instantly share code, notes, and snippets.

@garenyondem
Created August 12, 2018 07:56
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 garenyondem/fa665063111af5e95a78ee1ca9ac463a to your computer and use it in GitHub Desktop.
Save garenyondem/fa665063111af5e95a78ee1ca9ac463a to your computer and use it in GitHub Desktop.
const fs = require('fs').promises
(async () => {
try {
const data = JSON.parse(await fs.readFile('/path/to/file.json', 'utf8'))
} catch(err) {
console.error(err)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment