What’s New In Node 4.0.0?

Node 4.0.0A couple of months ago, I wrote a brief introduction to Node.js in the hope of explaining why it has become so popular so quickly. If you’re not sure why you should care about Node, take a look at that article. Today, I’m going to focus on new features and improvements that are included in the server-side JavaScript interpreter’s most recent version.

First things first, why 4.0.0? Most users of Node are using a version that hasn’t yet hit 1.0. I don’t want to get far into the weeds on this issue, but the nutshell explanation is that last year Node was forked into a couple of competing versions: Node.js, which was overseen by Node’s original creators Joyent, and io.js, which was a community project. The fork occurred because the community was unhappy with the pace of development.

Earlier this year, Joyent handed management of Node over to a new foundation and io.js was merged into the foundation. The name is Node.js again, but the Io.js project used a different versioning scheme and their most recent release was 3.0. Rather than confuse the issue, Node will be moving forward from 4.0.0. Node 4.0.0 is the stable version, and it’s the one that most developers should use.

(It’s 4.0.0 rather than 4 or 4.0 because Node now uses semantic versioning).

What’s New In Node?

Updated V8 JavaScript Engine

Node is based on the fast V8 JavaScript engine developed by Google for the Chrome browser. Most of the improvements in Node 4.0.0 are the result of integrating the newest version of V8. The fork we discussed earlier was in large part motivated by the fact that Node wasn’t incorporating the most recent versions of V8 fast enough.

The obvious direct advantage of an updated version of V8 is increased performance. Node has always been fast, and now it’s faster.
It’s worth noting that the new V8 version will break some Node modules — specifically the small proportion of “native” modules that are written in C++ and linked against a particular V8 version (or rather the abstraction library Nan). If something breaks when you update, this may well be the reason, but it’s likely that modules will be rebuilt for the new version quite quickly.

ECMAScript 6 Features

Because Node 4.0.0 is built against the most recent version of V8, it benefits from access the newest features to be included in the ES6 specification on which JavaScript is based. These include block scoping with let, classes, and generators. As someone more familiar with Python than JavaScript, generators are of particular interest to me because I miss them quite a bit when I’m developing in Node.

There are several other language changes that come along with ES6. You can see the full list here.

A More Predictable Release Cycle

Node is now serious business, with great uptake in the enterprise — an environment that prefers predictability. The Node team will be making LTS — Long Term Support — releases every 12 months, and each LTS version will be active for 12 months and maintained for another 18, which gives companies a predictable 30-month cadence of release lifespans.

If you’re using Node, the branch starting at Node 4.0.0 is the one you should follow for future releases and improvements.

Matthew Davis is a technical writer and Linux geek for Future Hosting.

Dedicated Server Special

Take advantage of our Double RAM offer on the E3-1230v2 4 x 3.30GHz+HT server! Only $134.95 per month. Managed and Unmanaged options available at checkout.