13 fabulous frameworks for Node.js

发布于 2016/05/09 12:47
字数 1565
阅读 40
收藏 1
13 fabulous Node.js frameworks

Node.js may be several years old now, but it's still in the spring of its life. The options are multiplying, as everyone experiments with new and better ways to deliver information from the platform. These efforts translate into dozens of frameworks for Node.js enthusiasts and newbies to explore, and new growth everywhere.

What follows are a few of the most prominent frameworks that have caught our eye. They make it simpler to build a complex website filled with pages, panels, fragments, and more. If you're starting a new project, try out a few of these to quickly build on all the prior work and experience that has been bundled into these projects.

[ Beyond jQuery: An expert guide to JavaScript frameworks. | Keep up with hot topics in programming with InfoWorld's Application Development newsletter. ]


Express is a very thin shell that offers a framework for lightweight processing of requests. It maps the URL to a template and fills in the values with data from a generic data store. The standard template engine is Consolidate, but the pattern is simple enough that most template engines will work quite well.

The Express team promises that MySpace is trying to upgrade its hipness score by building the next version in Express. If you don't remember MySpace, ask your grandparents. They may still have an account.

Express is distributed under the MIT license from GitHub.


The team that built Express decided to move on and build the next generation with a new, telescoping call stack called Koa.js that's designed to let you add new features to the call and response handshake. You start by writing a bit of code to handle the request, but then you can customize anything along the path. The middleware that handles all of the telemetry and error handling are open for your changes. There are also dozens of plug-in packages that add compression, caching, JSON encoding, and more to the stack.

The image above shows some of the Jade markup used by one of the templating libraries bundled with Koa.

Koa is distributed under the MIT license from GitHub.


The Total.js stack is designed to automate as much as possible. You start with a markup template for the HTML and CSS, and Total then compiles it into raw code and compresses it for delivery. In a sense, Total is one big compiler of websites masquerading as a framework.

The image above shows an example built to support a sushi bar website with ordering and more.

Total is distributed under the MIT license from GitHub.


One of the points of Node.js is to use the same language in the browser and the server. Derby.js takes this to the extreme by trying to run the same code in both and synchronizing the results. Then it tosses in template rendering, packaging, and some MVC to simplify the process. You don't need to worry about, say, compiling your CSS because Derby has it integrated.

The image above shows a basic To Do example distributed with the code.

Derby is distributed under the MIT License at GitHub.


Meteor.js is a real-time application designed to build Web apps that constantly synchronize with the server. Your changes to templates and data flow from the server to the browser automatically. The redrawing and the updating are handled directly by the underlying framework. This works, by the way, in both directions. Your browser code can make changes or write data as if the database is right there. The synchronization happens in the background.

The image above shows an app for synchronizing the work of emergency first responders built in Meteor.

Meteor is distributed under the Apache license with its own install script from the Meteor website and from Github.


Not every application requires full support for a browser. Restify is one of the server-side frameworks designed to serve up data and only data through an API. You fire it up and out comes JSON to everyone who shows up.

Restify places special emphasis on debugging and profiling so that you can drill down and optimize the performance of your server. DTrace is well-integrated and supported to make it possible to watch what happens and when it might go wrong.

The image above shows an audit packet saved from a debugging session.

Restify is available from GitHub under a very basic license that requires little except a notice of copyright.


You can build full websites with the Hapi framework, but many who use Hapi focus on building services that pull data from the background and deliver it quickly and efficiently. Each server is only a collection of maps between URL paths and functions that generate answers, and these routes are configured using the Hapi API rather than being baked into new code. The Hapi community supports a wide variety of plug-ins that tackle many of the chores of authentication and security necessary for building services.

The screenshot above shows a few of the standardized errors that are formalized by the Boom plug-in, which provides a set of utilities to help users better understand what has gone wrong when an HTTP error arises.

Hapi is available with a license requiring basic attribution from GitHub.


If you need to create a business-grade custom Web application, the Sails.js MVC framework will handle many of your app’s core tasks while remaining flexible enough to work with other tools. It is both “front-end agnostic” and ready to work with “any database,” according to the maintainers. The magic in between is largely automated, at least if you want to work with the standard REST API generated by the framework. If you’ve enjoyed the Ruby philosophy of convention and MVC separation, everything will be familiar to you -- and ready to go.

The illustration above shows the basic directory structure of a Sails app.

Sails is available under the MIT license from GitHub.


Most of the work of creating an API can be automated. Once you know the data model, building the tools for editing the data is largely an exercise. StrongLoop automates much of this and adds connectors for most of the big data stores like Oracle, MySQL, and MongoDB. To add more flexibility, they support either dynamic data models that evolve with time or static models with a fixed schema. It's your choice. There's also a ready-made security layer with access control lists and some good mobile services. All of this is built on top of Express so that you start with all of the Express feature set.

You can see StrongLoop's API explorer in the image above.

StrongLoop is available with either a hybrid open source license for test projects or under a subscription that includes support and more connectors to high-end databases like Oracle. Code is available at GitHub.


Many frameworks aim to deliver high-end support for full-featured users running browsers and interacting via JSON. ActionHero does that but also works on a lower-level, communicating directly with the TCP with wire protocols. It's great if you need something simpler than JSON. This can be quite useful if you want to send out raw files too because ActionHero delivers like a CDN without forcing you to run Apache or Nginx.

The image above shows ActionHero's stack with the sections devoted to handling the different actions and its connection to Redis.

ActionHero is available under the Apache license from GitHub.


Express and MongoDB are key components of the Node.js stack, but you need to knit them together and add a bit more functionality to actually deliver your message to the world. Keystone.js is meant to join Express and MongoDB together to complete the arch, in this case a content management system. This is now a bit easier thanks to Keystone’s scaffold-building service called Yeoman, which fills out the files and installs everything you might need to run a blog or post other content.

The image above shows a corner of an image-sharing demonstration page built using Yeoman and Keystone.

Keystone is available under the MIT license from GitHub.


SQL databases like PostgresQL or MySQL are from the old transactional world where you send off a command and wait for the answer. Node is built on the more asynchronous call-back architecture common in JavaScript. Sequelize merges the two. When you create an SQL query for any of the five major databases it supports, Sequelize sends the query off and promises to call your function when an answer arrives from the database. It marries the old world with the new architectural imperative.

The image above shows how an old SQL query can be rewritten to work in the modern world of Node.

Sequelize’s source code is released under a basic attribution license from GitHub.


Mean isn’t really a framework for Node.js; it’s a collection of frameworks and technologies that are pre-optimized to play well together, under the acronym MEAN, which stands for MongoDB, Express, Angular, and Node. Each component is among the most popular parts of the Node ecosystem on their own; together, they’re even easier to use.

The image above shows how the Node package manager will install the parts and a new command, mean, for developing applications.

The parts that make up Mean are available under their own licenses from their own repositories.


粉丝 11
博文 156
码字总数 35677
作品 0
私信 提问
13 款惊艳的 Node.js 框架——第2部分

【编者按】本文作者为 Peter Wayner,主要介绍13款至精至简的 [Node.js][1] 框架,帮助你简化高速网站、丰富 API 以及实时应用的开发流程。本文系国内 [ITOM][2] 管理平台 [OneAPM][3] 编译呈...

WebStorm 11 增加 Node.js 编码助手

WebStorm 11 增加 Node.js 编码助手,激活这一功能的方法:在 Preferences | Languages & Frameworks | Node.js and npm 点击 Code Assistance 下方的 Enable 。 WebStorm 11 还增加了检查 ...


Node.js进阶教程第一步(基础篇)—18659人已学习 课程介绍 本课程从Node.js的安装配置开始,包括函数调用,模块调用,路由,文件操作,异常处理,参数接收,正则表达式,连接数据库,事件等内...


这篇文章编译整理自Stack Overflow的一个如何开始学习Node.js的Wiki帖,这份资源列表在SO上面浏览接近60万次,数千个收藏和顶。特意整理发布到这里,其中添加了部分中文参考资料。 学习指南和...


Error: Failed to lookup view "E:\study\nodejs\DoraCMS-master/views/web/temp/doraGallery/public/do500" in views directory "E:\study\nodejs\DoraCMS-master\views" at EventEmitter.a......






ps.本文为《从Paxos到Zookeeper 分布式一致性原理与实践》笔记之一 ZooKeeper ZooKeeper曾是Apache Hadoop的一个子项目,是一个典型的分布式数据一致性的解决方案,分布式应用程序可以基于它...

redis 学习2

网站 启动 服务端 启动redis 服务端 在redis 安装目录下 src 里面 ./redis-server & 可以指定 配置文件或者端口 客户端 在 redis 的安装目录里面的 src 里面 ./redis-cli 可以指定 指定 连接...

Spring boot 静态资源访问

0. 两个配置 spring.mvc.static-path-patternspring.resources.static-locations 1. application中需要先行的两个配置项 1.1 spring.mvc.static-path-pattern 这个配置项是告诉springboo......

hash slot(虚拟桶)

在分布式集群中,如何保证相同请求落到相同的机器上,并且后面的集群机器可以尽可能的均分请求,并且当扩容或down机的情况下能对原有集群影响最小。 round robin算法:是把数据mod后直接映射...

Kafka 原理和实战

本文首发于 vivo互联网技术 微信公众号 https://mp.weixin.qq.com/s/bV8AhqAjQp4a_iXRfobkCQ 作者简介:郑志彬,毕业于华南理工大学计算机科学与技术(双语班)。先后从事过电子商务、开放平...