Home

Awesome

A comparison of server-side node frameworks. This may include frameworks with a browser-side component.

Frameworks

Only frameworks with over 1,000 stars are currently added. Feel free to add your own. The frameworks are listed by number of watchers, descending, as of March 18, 2014.

FrameworkSponsor(s) / Author(s)WatchersStars
MeteorMeteor Development Group97311,687
ExpressStrongLoop / TJ Holowaychuk82812,824
SailsMike McNeil4855,582
KoaTJ Holowaychuk2323,160
DerbyNate Smith Brian Noguchi2133,079
KrakenPayPal2102,424
HapiWalmart Labs2041,981
ConnectSencha Labs2024,180
LoopBackStrongLoop1872,602
RestifyMark Cavage1222,001
GeddyMatthew Eernisse1011,703
CompoundJSAnatoliy Chakkaev911,542
FlatironNodejitsu751,146

Stack Integration

Traditionally, frameworks are explicitly server-side. However, there are now frameworks that are vertically integrated, i.e. integrate the client with the server.

FrameworkServer-sideClient-side
Meteor
Express
Sails
Koa
Derby
Kraken
Hapi
Connect
LoopBack
Restify
Geddy
CompoundJS
Flatiron

Dependencies

Some frameworks are built upon other frameworks.

FrameworkDependencies
Meteor
ExpressConnect for < 4.0.0
SailsExpress
Koa
Derby
KrakenExpress
Hapi
Connect
LoopBackExpress
Restify
Geddy
CompoundJS
Flatiron

Source Lines of Code

This is the lines of code a framework uses, not including comments. This is used to gauge complexity and modularity of a framework.

FrameworkSource Lines of CodeVersion
Meteor
Express1,1504.0.0-rc3
Sails5,3500.10.0-rc4
Koa5500.5.1
Derby1,4500.6.0-alpha3
Kraken6800.7.
Hapi4,7503.0.0
Connect1203.0.0-rc1
LoopBack10,4722.8.0
Restify3,9702.6.3
Geddy5,6600.12.4
CompoundJS3,0101.1.13-1
Flatiron5810.3.11

Note: sloc is used to calculate the SLOC. Most are simply counted by running sloc lib and lines of source code is used.

Middleware/Plugin Signature

Different frameworks use plugins and middleware differently. Some use objects, others use functions. Some work with node's req and res objects, whereas many others do not.

A framework "supports node" if node's req and res objects are passed to plugins and middleware, and using node's req and res objects is supported.

FrameworkSignatureSupports Node
Meteor×
Expressapp.use(function (req, res, next) {})
Sailsfunction(req, res, next)
Koaapp.use(function* (next) {})×
Derby
Krakenapp.use(function (req, res, next) {})
Hapiapp.ext('onRequest', function (req, next) {})×
Connectapp.use(function (req, res, next) {})
LoopBackapp.use(function (req, res, next) {})
Restifyapp.use(function (req, res, next) {})
Geddythis.before(function (req, res) {})
CompoundJS
Flatiron

Error Handling

Error handling in node.js is wonderful! The current solution to catch uncaught exceptions (emitters and streams throwing errors everywhere) is to use domains (unless you listen to every error). If a framework does not handle uncaught exceptions, then domains should probably use domains.

FrameworkMiddleware/PluginUncaught Exceptions Handling
Meteor
Expressnext(err) / app.use(function (err, req, res, next) {})×
Sails
Koatry/catch× - Unnecessary with generators
Derby
Krakennext(err) / app.use(function (err, req, res, next) {})
Hapidomains
Connectnext(err) / app.use(function (err, req, res, next) {})×
LoopBacknext(err) / app.use(function (err, req, res, next) {})x
Restifynext(err)
Geddy
CompoundJS
Flatiron

Control Flow

Most frameworks use only node's traditional callbacks for control. As we move towards ES6, we will see frameworks that use generators and promises to avoid callback hell. Any framework without a control flow is assumed to use callbacks unless otherwise specified.

FrameworkControl Flow
Meteorfibers
Express
Sails
Koagenerators - co
Derby
Kraken
Hapi
Connect
LoopBack
Restify
Geddy
CompoundJS
Flatiron

Included Features

If a feature is not included, there is a very good possibility that it can be used via middleware or plugin. Which features a framework includes or does not include is unimportant - its philosophy is.

FrameworkContent NegotiationCookie ManagementRoutingView SystemBody ParsingMultipart Parsing
Meteor
Express
Sails
Koa
Derby
Kraken
Hapi
Connect
LoopBack
Restify
Geddy
CompoundJS
Flatiron
FrameworkSession ManagementCSRF ProtectionCompressionFile UploadsBasic Authentication
Meteor
Express
Sails
Koa
Derby
Kraken
Hapi
Connect
LoopBack
Restify
Geddy
CompoundJS
Flatiron

Database

FrameworkRequired DatabasesRecommended DatabasesCompatible Databases
MeteorMongoDB
Express
SailsMongoDB, MySQL, Postgres
Koa
Derby
Kraken
Hapi
Connect
LoopBackMicrosoft SQL Server, MongoDB, MySQL, Oracle, Postgres
Restify
GeddyLevelDB, MongoDB, MySQL, Postgres, Riak, SQLite
CompoundJS
Flatiron

Templating

FrameworkRequired Templating SystemsRecommended Templating SystemsCompatible Templating Systems
Meteorhandlebars
Expressconsolidate
Sailsconsolidate
Koa
Derbyhandlebars-like
Krakendustjsconsolidate
Hapi
Connect
LoopBackconsolidate
Restify
Geddyhandlebars, EJS, Jade, Swig, mustache
CompoundJS
Flatiron

consolidate means that the framework supports any templating system supported by consolidate.js.

Contributing

When adding a new framework, you must add the simplest metadata such as links, SLOC, stack, and dependencies. Frameworks without a decent amount of stars are not welcomed. Do not spam your brand new framework.

Performance comparisons are not welcomed.

Metadata should be updated for the latest stable versions, including release candidates, but not including alpha or beta versions.

License

The MIT License (MIT)

Copyright (c) 2014 Jonathan Ong me@jongleberry.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.