Skip to content

Instantly share code, notes, and snippets.

@tosipaulo
Created July 19, 2017 20:50
Show Gist options
  • Save tosipaulo/5dcebbba0897bf116f076c00c4b07cee to your computer and use it in GitHub Desktop.
Save tosipaulo/5dcebbba0897bf116f076c00c4b07cee to your computer and use it in GitHub Desktop.
Exercício 5
const readdirPromise = (path) => {
return new Promise((resolve, reject) => {
fs.stat(path, (err, stat) => {
if(err){
reject(err)
}else{
resolve(stat.isFile())
}
})
})
}
readdirPromise(path).then((files) => console.log(files))
@tuliofaria
Copy link

Para esse exercício seria interessante seguir essa abordagem: https://www.youtube.com/watch?v=nnsz91rhWuA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment