What’s new for Node?
Speed things up and bring the newest features server-side in version 10
The latest major update came in April this year and brought with it lots of small but very useful features to make the development of server applications easier and more secure. The most prominent update is to do with modules. Node has been using Commonjs modules for a long time. With the introduction of Ecmascript modules in ES2015, Node has been trying to let the two work together despite their slight differences. They are now available when used with the ‘--experimental-modules’ flag. An in-depth explainer for this by Gil Tayar can be found at https://medium.com/@giltayar/ ee5ea3001f71. Errors have also been significantly improved, with standardised codes being introduced where there were previously only string descriptions. Whilst before any errors would have to match against that generic string, version 10 introduces standardised error codes that return alongside the string description. A slight change to the description of an error will no longer break an application. A new set of experimental asynchronous file system methods have also been added to the “fs” module. Instead of using callbacks, these use promises to communicate with the system in a more readable and efficient manner. Finally, version 10.7 also includes version 6.1 of npm. This release focuses mainly on performance and security improvements, including the new ‘npm audit’ command, which can check if any dependant packages have known security vulnerabilities.
With the introduction of Ecmascript modules in ES2015, Node has been trying to let the two work together despite their slight differences