What’s New in Node 12

An overview of the Node.js 12 features and updates for the JavaScript runtime

Trey Huffine
Level Up Coding
Published in
4 min readApr 23, 2019

--

Node.js continues its yearly release cycle with version 12 (codenamed Erbium). Since this is as even-numbered version, it will go into Long Term Support (LTS) beginning on October 2019 and reach its end of life in April 2022.

In contrast, the odd-numbered releases are non-LTS and exist for 6–8 months between LTS releases. These are used to prepare for the next LTS release.

Node 12 is packed with great features and notable upgrades to the runtime. In addition, since Node uses the V8 engine maintained by Google and used in Chrome, Node will receive all updates from that as well.

Node 12 Features

import / export statements supported (no bundler required)

Node 12 enters Phase 3 for ECMAScript Modules which correspond to a path to stability of the modules inside Node. Initially, it will still be behind the --experimental-modules flag, and the plan is to remove the flag by the time Node 12 goes into LTS in October.

The import/export syntax has become the preferred module syntax for JavaScript developers since its standardization in ES6, and the Node team has been working diligently to enable it natively. Experimental support began in Node 8.0 at phase 0 and is taking a major step with the newest Node release. All major browsers support ECMAScript modules via <script type="module">, so this is a huge update for Node.

Phase 3 will support 3 types of import from ES modules files (works with all built-in Node packages):

// default exports
import module from 'module'
// named exports
import { namedExport } from 'module'
// namespace exports
import * as module from 'module'

If you import from a CommonJS package, you can only import using default export syntax import module from

--

--

Founder | Software Engineer. Building products that empower individuals.