Closed jeffijoe closed 7 years ago
I think you can use generator version(2.x) with koa-convert, this branch will be maintained till node 8 released.
I don't think we should use plain promise to write middleware for koa which aim to help people write asynchronous code more easy.
also 3.x is using plain promise, but maybe lack of maintenance.
The middleware implementation is just a detail, the problem is not using async-await in your app, but transpiling koa-bodyparser
for < Node 7.6
And I think for a middleware that is used as much and as often as a bodyparser, it would make sense to squeeze as much perf out of the runtime as possible.
I love async-await, but this module now requires me to update to node 7.6 which still isn't very supported by some modules like
bcrypt
.I know this isn't
koa-bodyparser
's problem, but Koa 2 itself can run on Node 6 with plain promises while installing (official Koa) middleware requires 7.6 which feels like a disconnect.Using plain promises shouldn't be too hard in this case and would also inevitably give better performance (micro but it's free) and wider support.