Skip to content

Instantly share code, notes, and snippets.

@watilde
Created August 30, 2017 11:49
Show Gist options
  • Save watilde/b17ccc56058ee56d2ad8e3acce725ced to your computer and use it in GitHub Desktop.
Save watilde/b17ccc56058ee56d2ad8e3acce725ced to your computer and use it in GitHub Desktop.
const asde = require('asde')
const fs = require('fs')
const stat = asde(fs.stat)
async function main () {
const [errStat, config] = await stat('./config')
if (errStat) {
return console.error(errStat)
}
// magic number
const [errStat2, value] = await stat('./file')
if (errStat2) {
return console.error(errStat)
}
console.log(value)
console.log(value)
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment