Last active
September 15, 2018 15:53
-
-
Save nriesco/d3fdb12ca754d1db450a39d8d40c3829 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ref: https://stackoverflow.com/a/37576787/2027670 | |
async function parallelFiles () { | |
const files = []; // some data | |
await Promise.all(files.map(async (file) => { | |
const contents = await fs.readFile(file, 'utf8') | |
console.log(contents) | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment