A year ago we wrote a post on How to Become a Better Node.js Developer in 2016 which was a huge success – so we thought now it is time to revisit the topics and prepare for 2017!
In this article, we will go through the most important Node.js best practices for 2017, topics that you should care about and educate yourself in. Let’s start!
Node.js Best Practices for 2017
Last year we advised you to use ES2015 – however, a lot has changed since.
Back then, Node.js v4 was the LTS version, and it had support for 57% of the ES2015 functionality. A year passed and ES2015 support grew to 99% with Node v6.
If you are on the latest Node.js LTS version you don’t need babel anymore to use the whole feature set of ES2015. But even with this said, on the client side you’ll probably still need it!
For more information on which Node.js version supports which ES2015 features, I’d recommend checking out node.green.
Promises are a concurrency primitive, first described in the 80s. Now they are part of most modern programming languages to make your life easier.
Imagine the following example code that reads a file, parses it, and prints the name of the package. Using callbacks, it would look something like this: