5.12.0

Latest release in branch 5.x
Released 9 years ago (June 23, 2016)

Software Node.js
Branch 5.x
Status
End of life
End of bug fixes June 30, 2016
End of security fixes June 30, 2016
First official release version 5.0.0
First official release date 10 years ago (October 29, 2015)
Release notes https://github.com/nodejs/node/releases/tag/v5.12.0
Source code https://github.com/nodejs/node/tree/v5.12.0
Documentation https://nodejs.org/dist/latest-v5.x/docs/api/
Download https://nodejs.org/download/release/latest-v5.x/
Node.js 5.x Releases View full list

What Is New in Node.js 5?

CategoryChange
New Featuresnpm 3 bundled (flat node_modules layout)
New FeaturesV8 4.6 -- spreading arguments in function calls
ImprovementsBuffer: Buffer.prototype.indexOf() added
Improvementsfs: fs.watch() reliability improvements
ImprovementsStrict mode for the REPL
Improvementsnet: allow host option to be an IP
SecurityOpenSSL 1.0.2d

npm 3 -- Flat Dependency Layout

Node.js 5 bundles npm 3, which changes the node_modules layout from a deeply nested tree to a flat structure. This resolves Windows path length limitations and reduces module duplication -- the same package version is hoisted to the root node_modules where possible.

The trade-off: npm 3 installs are slower due to the additional dedupe analysis step. npm 4 (Node.js 7) and npm 5 (Node.js 8) address speed progressively.

Spread in Function Calls via V8 4.6

V8 4.6 enables spread syntax in function calls. This replaces the verbose Function.prototype.apply() pattern for passing arrays as function arguments.

// Before spread
Math.max.apply(null, [1, 2, 3, 4]); // 4

// With spread (Node.js 5+)
Math.max(...[1, 2, 3, 4]); // 4

function logAll(...args) {
  args.forEach(a => console.log(a));
}
logAll('a', 'b', 'c');

Buffer.indexOf() for Binary Search

Buffer.prototype.indexOf() lets you search for a string, byte, or another Buffer within a Buffer without converting to a string first. Useful for parsing binary protocols where you need to find a delimiter sequence.

const buf = Buffer.from('Hello World');
buf.indexOf('World'); // 6
buf.indexOf(0x57);    // 6 (ASCII 'W')

FAQ

Is Node.js 5 an LTS release?
No. Node.js 5 is a Current release that reached end-of-life in June 2016. The concurrent LTS was Node.js 4.

Why is npm 3's flat layout important?
Windows has a maximum path length of 260 characters. The nested node_modules layout of npm 2 regularly exceeded this for deeply nested packages, causing failures on Windows that did not occur on macOS or Linux. The flat layout makes Node.js projects reliably cross-platform.

Is V8 4.6 a significant V8 version?
It starts implementing more ES6 features in stages. Spread in calls is one piece. Arrow functions, let/const, and template literals were already available in earlier versions. Full ES6 coverage completes across Node.js 6-8.

Does Buffer.indexOf() handle multi-byte search patterns?
Yes. You can search for a Buffer (e.g., a byte sequence Buffer.from([0xDE, 0xAD])) and it returns the first offset where the sequence begins.

What is the Node.js 5 REPL strict mode?
The REPL can be started with node --use_strict, which runs all REPL input in strict mode. Useful for catching silent errors (undeclared variables, duplicate parameters) during exploratory development.

Releases In Branch 5.x

Version Release date npm version
5.12.0 9 years ago
(June 23, 2016)
3.8.6
5.11.1 9 years ago
(May 05, 2016)
3.8.6
5.11.0 9 years ago
(April 21, 2016)
3.8.6
5.10.1 10 years ago
(April 05, 2016)
3.8.3
5.10.0 10 years ago
(April 01, 2016)
3.8.3
5.9.1 10 years ago
(March 22, 2016)
3.7.3
5.9.0 10 years ago
(March 16, 2016)
3.7.3
5.8.0 10 years ago
(March 09, 2016)
3.7.3
5.7.1 10 years ago
(March 02, 2016)
3.6.0
5.7.0 10 years ago
(February 23, 2016)
3.6.0
5.6.0 10 years ago
(February 09, 2016)
3.6.0
5.5.0 10 years ago
(January 21, 2016)
3.3.12
5.4.1 10 years ago
(January 12, 2016)
3.3.12
5.4.0 10 years ago
(January 06, 2016)
3.3.12
5.3.0 10 years ago
(December 15, 2015)
3.3.12
5.2.0 10 years ago
(December 09, 2015)
3.3.12
5.1.1 10 years ago
(December 03, 2015)
3.3.12
5.1.0 10 years ago
(November 17, 2015)
3.3.12
5.0.0 10 years ago
(October 29, 2015)
3.3.6