From 1f72eb132d56394f2bc4c2c00efbcc72b5ef7afe Mon Sep 17 00:00:00 2001 From: Matthew Welke Date: Sun, 11 Mar 2018 19:58:31 -0400 Subject: [PATCH] Updated readme example's async example to use IIFE instead of function definition. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 50d6557..587978e 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,9 @@ With ES2017, this will allow you to use async functions cleanly with node's core ```js const fs = require('mz/fs') - -async function doSomething () { +(async function () { if (await fs.exists(__filename)) // do something -} +})() ``` ## Promisification