Node.js 5!

It’s this time of year again, Node.js 5.0.0 has been released and it the next stable release of Node.js.

Now, Node.js 4.x.x is still the goto release if you have large roll outs of Node.js within your organisation. 4.x.x will still be receiving security and general matenance updates for the duration of its LTS life-cycle, However if you want the latest and greatest features then 5.0.0 will be more than stable.

What is new?


  • Implements the spread operator, see.
\[...iterableObj, 4, 5, 6\]
  • Implements, see.
function Foo() {    
  if (! throw "Foo() must be called with new";  
  console.log("Foo instantiated with new");  



  • console.time() - resolution now has 3 decimals of added accuracy.


  • fs.readFile fs.writeFile fs.appendFile These all now accept a file descriptor as their first argument.


  • No more duplicates of the following headers: Retry-After, ETag, Last-Modified, Server, Age, Expires.
  • Http methods and header names must conform to RFC 2616 “token” rules — /^[a-zA-Z0-9_!#$%&’*+.^`|~-]+$/ or a TypeError.
  • OutgoingMessage#setTimeout() - must be a function or a TypeError is thrown (James M Snell)


  • ALPN support has been added.
  • createSecurePair() - can now be passed a TLS option.


  • Now throws on unexpected end of files.

What is deprecated?


  • _linklist
  • require.paths
  • require.registerExtension()


  • raw and raws have been removed as encoding types.


  • .p()

What has changed?


  • fs.readFile Some errors are now returned in the callback instead of being thrown.


  • inherits has been updated to work with ES6 classes, however the prototype has been rearranged and could be a breaking change for some consumers.


  • from


  • setTimeout().unref() - Attempt to reuse the timer handle internally; This fixes a long-standing known issue where unrefed timers would perviously hold beforeExit open.


.connect() - The default minimum DH key size is now 1024 bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent “logjam” attacks. A new minDHSize TLS option can be used to override the default


Checkout the whole changelog here:

At YLD! for any production code we will continue using 4.x.x, however for our own projects we will be playing around with 5.x.x

Written by Tom Gallacher— Staff Engineer at YLD.

Interested in Node? Read more about it:

Written by YLDNovember 2nd, 2015

Share this article