wga
wga is a small JS function which can wrap a generator or async function to used as request handlers and middlewares in Express. wga.js brought modern async write style to Express
Installing
npm install wga --save
Using with generator
var wga = var app = app
In the above example, the thrown error will be passed to next
, which in
Express's case calls the error handling middleware later on. If the generator succeeds, the next
callback will not be called.
If you need to, like in middleware handlers, you can always call next
yourself:
app
Using with async function
app app
License
MIT