What Is New in Node.js 7?
| Category | Change |
|---|---|
| New Features | V8 5.4 -- async/await behind --harmony flag |
| New Features | WHATWG URL parser (experimental) |
| Improvements | Upgraded npm to 4.0 |
| Improvements | --inspect flag for Chrome DevTools debugging |
| Improvements | Buffering of child process stdio |
| Improvements | cluster: worker kill method |
| Security | OpenSSL 1.0.2j |
async/await Preview via --harmony-async-await
Node.js 7 previews async/await behind the --harmony-async-await V8 flag. While not production-ready without a flag, many developers use this to prototype the programming model before Node.js 8 makes it stable.
# Enable async/await in Node.js 7
node --harmony-async-await server.js
This release signals the direction of Node.js development. Teams start refactoring callback-heavy code to promises in preparation for native async/await in Node.js 8.
Chrome DevTools Integration via --inspect
The --inspect flag (introduced experimentally in Node.js 6) gains improved support in Node.js 7. You can attach Chrome DevTools to a running Node.js process for breakpoint debugging, heap profiling, and CPU profiling -- a major improvement over the legacy --debug + node-inspector workflow.
npm 4 Bundled
npm 4 ships with Node.js 7. Key changes: prepublish scripts now only run on npm publish (not npm install), fixing a long-standing confusion. The prepublishOnly hook is added for publish-specific scripts.
FAQ
Is Node.js 7 an LTS release?
No. Node.js 7 is a Current release that reached end-of-life in June 2017. The concurrent LTS was Node.js 6.
Can I use async/await in production with Node.js 7?
Only with the --harmony-async-await flag, which is experimental. For production, wait for Node.js 8 which ships stable async/await, or use Babel to transpile.
Does Node.js 7 support ES6 destructuring without a flag?
Yes. ES6 features like destructuring, template literals, arrow functions, classes, and spread operators have been available without flags since Node.js 6.
What is the WHATWG URL parser in Node.js 7?
It is the same standard-compliant URL class as in browsers. It is experimental in v7 and stabilizes in Node.js 10. The legacy url.parse() continues to work in parallel.
How does --inspect differ from the legacy --debug flag?--debug used the V8 Debugger Protocol v1 and required the separate node-inspector npm package. --inspect uses the V8 Inspector Protocol (same as Chrome DevTools) and works directly with Chrome's built-in DevTools -- no extra install needed.