News for hackers. Stuff that matters.
Re:Is Express.js dying? by niftylettuce on Sunday January 17, 2016 @10:32AM (#10919703)
Just use koa@next, it's awesome. ES6/ES7 with Babel, Flowconfig, and more.
Re:Is Express.js dying? by LukeB_UK on Sunday January 17, 2016 @10:44AM (#10919748)
Another good alternative is Hapi: http://hapijs.com/
Re:Is Express.js dying? by niftylettuce on Sunday January 17, 2016 @06:09PM (#10921543)
Not in my opinion, way too complex. It'll end up just like all the other frameworks that try to do everything; outdated and unmaintained.
Re:Is Express.js dying? by onestone on Sunday January 17, 2016 @11:12AM (#10919860)
Hapi might be an alternative to Express (both are outdated callback-style frameworks), but it's in no way an alternative to Koa.
Re:Is Express.js dying? by l1ambda on Sunday January 17, 2016 @12:34PM (#10920144)
Koa middleware are generally more composable and more robust than Express. In Koa, middleware flows down and up in a stack-like manner with the help of generators. E.g., in Koa you set an X-Response-Time header like so:

https://github.com/koajs/response-time/blob/master/index.js

The response time middleware records the start time, then yields to any other middleware, and finally sets the header.

You just can't do that as nicely in Express. Here is the Express version:

https://github.com/expressjs/response-time/blob/master/index...

responseTime has to wait to be called via "on-headers". on-headers is a separate module that monkey-patches response.writeHead.

The Koa version is 21 lines of code (really just 4 LOC), while the express version is over 200 LOC.