diff --git a/docs/docs/api/promise.map.md b/docs/docs/api/promise.map.md index e8b267472..fdb5a2b29 100644 --- a/docs/docs/api/promise.map.md +++ b/docs/docs/api/promise.map.md @@ -42,6 +42,13 @@ Promise.map(fileNames, function(fileName) { console.log("done"); }); +// Using Promise.map and async/await: +await Promise.map(fileNames, function(fileName) { + // Promise.map awaits for returned promises as well. + return fs.readFileAsync(fileName); +}); +console.log("done"); + ``` A more involved example: