ExpressJS 4.0 has been released
expressjs.com
expressjs.com
[1] http://www.quora.com/TJ-Holowaychuk-1/How-is-TJ-Holowaychuk-...
> Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation
I think he meant successor in the spiritual sense, which is undeniably true.
#!/usr/bin/env node --harmony
var fs = require('fs'),
co = require('co'),
thunkify = require('thunkify'),
request = require('request'),
readFile = thunkify(fs.readFile);
get = thunkify(request.get);
var log = console.log.bind(console);
// Create a thunk, and run it immediately.
co(function *(){
try {
var fileContents = yield readFile('myfile', 'utf8');
log(fileContents);
var yahoo = (yield get('http://yahoo.com'))[0];
log(yahoo.statusCode)
} catch(error) {
log('Oh no, an error!')
log(error.code)
}
})()
Async, inline, catching errors. It's nice.You can start throwing that on mocha too, it's pretty sweet.
And yes, TJ built that too.
[1]: https://github.com/senchalabs/connect
EDIT: Looks like Express doesn't use Connect anymore. I'm out of the loop.
This is very good news for me.
Also, how to migrate guide can be found here: https://github.com/visionmedia/express/wiki/Migrating%20from...
1. https://github.com/expressjs/body-parser/blame/master/index....
You would have gotten: https://github.com/expressjs/body-parser/commit/86446f74d5c6...
Which shows parents 0
For instance, his response to the whole n rm -rf debacle: "yeah it's kinda tough when you have 250+ OSS projects, inevitably some get messed up over time and I merge broken shit haha". That being said, it looks like he's let other folks take over Express (who are all qualified). He didn't even know the logger was named "Morgan" until he read it in a blog post about Express 4.
https://github.com/visionmedia/express/wiki/Migrating-from-3...
http://sailsjs.org/#! https://www.meteor.com/ http://www.mean.io/#!/
Also, decoupling default middleware and putting them into their own modules seems like the way to go, and more 'node-y' than packing everything together.
I'll be glad to get rid of the connect warnings too !
Although there's koajs, it's nice to see express is still getting some love
i.e. you're no longer mounting the router on top of another kernel.
This will help me build better architecture for application on top of express
Its a bit high level than Express but same performance wise. I like it becoz you get started in 2 minutes.