Skip to content

Commit 9a30d83

Browse files
committed
Update readme
1 parent 6defec0 commit 9a30d83

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![install size](https://badgen.net/packagephobia/install/express-async-errors)](https://packagephobia.now.sh/result?p=express-async-errors)
55
[![npm package version](https://badgen.net/npm/v/express-async-errors)](https://npm.im/express-async-errors)
66

7-
A dead simple ES6 async/await support hack for [ExpressJS](http://expressjs.com)
7+
A dead simple ES6 generators and async/await support hack for [ExpressJS](http://expressjs.com)
88

99
Shamelessly copied from [express-yields](https://github.com/MadRabbit/express-yields)
1010

@@ -30,6 +30,12 @@ app.get('/users', async (req, res) => {
3030
const users = await User.findAll();
3131
res.send(users);
3232
});
33+
34+
// or with generators
35+
app.get('/users', function* (req, res) {
36+
const users = yield User.findAll();
37+
res.send(users);
38+
});
3339
```
3440

3541
This library is about what happens when you hit an error.

0 commit comments

Comments
 (0)