Created
July 19, 2017 20:50
-
-
Save tosipaulo/5dcebbba0897bf116f076c00c4b07cee to your computer and use it in GitHub Desktop.
Exercício 5
This file contains 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 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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para esse exercício seria interessante seguir essa abordagem: https://www.youtube.com/watch?v=nnsz91rhWuA