Skip to content

Commit 1f72eb1

Browse files
committed
Updated readme example's async example to use IIFE instead of function definition.
1 parent f3d4c79 commit 1f72eb1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ With ES2017, this will allow you to use async functions cleanly with node's core
3535
```js
3636
const fs = require('mz/fs')
3737

38-
39-
async function doSomething () {
38+
(async function () {
4039
if (await fs.exists(__filename)) // do something
41-
}
40+
})()
4241
```
4342

4443
## Promisification

0 commit comments

Comments
 (0)