Learn how Node.js versioning works and which ES6 features are supported in Node.js.
- [Teacher] Since the versions of V8 and Nodejs highly impact which ES6 features that you can use, I thought it would be useful to talk about how versioning works with Node. The node project documents, their release plan and the LTS project on their GitHub. Node.js major versions are released on a strict six month release cycle. And as of this video, version seven is the latest version available. Node has at least two versions available at all times. A current version which includes the newest features available, and a long term support version which is supported with security patches and bug fixes during an 18 month period.
Each release of Node ships with a specific version of V8, and typically a major or minor release of Node will include updated versions of V8. That version of V8 may have implemented a new feature from the ECMAScript specification which would mean the new version of Node.js would also support that feature. I like to use the site node.green to see which features are available in which version of Node. It looks like version seven is currently 99% complete with its implementation of ES6.
It's likely that the remaining 1% will never be implemented by V8 or Node. And these unimplemented pieces are usually very specific behavior of particular features, not entire features themselves. The current LTS version of Node.js is version six, and that has a 99% implementation of ES6. For this course, we will be targeting that version. Depending on when you watch this video, the current LTS may be greater than six, and it's fine if you use any version greater.
If you already have Node installed on your system, please make sure it at least meets that version requirement.
- Using arrow functions
- Using default parameters
- Reviewing the class structure in ES6
- Assigning variables with let and const
- Array destructuring and object destructuring
- Replacing callbacks with promises
- Keeping values unique with Set
- Dropping the prototype with Map
- Working with generators
- Using yield with arguments