Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimyr committed Nov 20, 2019
1 parent 6defec0 commit 9a30d83
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![install size](https://badgen.net/packagephobia/install/express-async-errors)](https://packagephobia.now.sh/result?p=express-async-errors)
[![npm package version](https://badgen.net/npm/v/express-async-errors)](https://npm.im/express-async-errors)

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

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

Expand All @@ -30,6 +30,12 @@ app.get('/users', async (req, res) => {
const users = await User.findAll();
res.send(users);
});

// or with generators
app.get('/users', function* (req, res) {
const users = yield User.findAll();
res.send(users);
});
```

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

0 comments on commit 9a30d83

Please sign in to comment.