Choosing a NodeJS Framework

Journal

In recent years, NodeJS has become a go-to framework for modern web application development, providing a runtime environment that allows the use of JavaScript for both client-side and server-side application code.

In recent years, NodeJS has become a go-to framework for modern web application development, providing a runtime environment that allows the use of JavaScript for both client-side and server-side application code.

Although W3Tech’s March report comparing NodeJS with Nginx and Apache usage shows NodeJS at only 0.4%, by providing the ability to work with one programming language across the entire application development stack, it is the perfect choice for JavaScript developers.

Other benefits of it’s architecture are it’s use of JavaScript event loops, making it an attractive choice for those building event-based, data-driven applications that may be single-page and/or real-time.

As with any web technology after initial adoption, many frameworks, modules & libraries have rose to help support high quality development.

In this article I would like to highlight some of the most-used frameworks that can handle any project’s level of complexity, with some providing more features than others — and then also briefly cover a variety of bespoke solutions that serve a specific site’s requirements.

MVC Frameworks

Express

github.com/expressjs/expressjs.com

ExpressJS is probably the most well-known NodeJS framework, and although there are many reasons — one that clearly stands out is performance.

ExpressJS takes the approach of being as lightweight and minimal a framework as possible, while still providing the functionality to configure, build and deploy an application to your requirements.

Express’ generator feature is also a great feature for new projects, where a variety of application skeletons are available to use to help you hit the ground running.

Meteor

github.com/meteor/meteor

Meteor provides a more heavy-duty utility belt for application development compared with ExpressJS, providing integrated support with MongoDB to handle data-driven applications for example.

Meteor, like the other MVCs listed, is agnostic to React and Angular frameworks and makes it easy to work with client-side frameworks of your choice.

Meteor also comes with integration of the Apache Cordova, providing the ability to wrap and publish your project as a native application. With the Cordova integration in Meteor, you can take your existing app and run it on an iOS or Android device with a few simple commands.

Sails

github.com/balderdashy/sails

SailsJS prides itself on how it is “especially good for building realtime features like chat.” — from this perspective, Sails JS is best suited and of interest to those developing real-time applications such as chat rooms and multiplayer games.

Sails is built on-top of Node.js, Express, and Socket.io.

Bespoke frameworks

Alongside the previously mentioned frameworks, there are a variety that also serve more specific project focuses, and if your current or upcoming project fits the criteria — they may be of better preference than the above.

Ghost

github.com/tryghost/ghost

Ghost provides a framework for your blogging/publication needs. Think Wordpress, only on NodeJS.

Since it’s initial release as an open-source blogging platform, the organisation behind the project have developed the framework to a point where they now offer hosted Ghost solutions to new users.

Although they suggest using this service, they also provide documentation for setting up a self hosted Ghost application. The source code they use for their premium service is also that of the open-source application code, so you can also expect consistent updates and improvements over time.

Reaction

github.com/reactioncommerce/reaction

Reaction Commerce, as the name suggests, is suited to developing e-commerce websites built with NodeJS. The description on their Github repository describes it as “an event-driven, real-time reactive commerce platform built with JavaScript (ES6). It plays nicely with npm, Docker, and React.”.

It appears to be a NodeJS project developing similarly to that of Apache’s Magento framework.

Wintersmith

github.com/jnordberg/wintersmith

For when your website does not require functionality such as an API or database, Wintersmith may fit to your needs as an static-website generator.

With support for rendering using templates & Markdown, it is an effective lightweight solution for websites such as Blogs or Portfolios, where you do not require the functionality that other frameworks provide.