Need to Node – Volume 69
In this special edition of Need to Node, you can find the top 10 highlights in Node.js in 2020!
Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!
Awesome Articles, Links, and Resources
In other words EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them! Find out more in this article
8) Experimental Support for WebAssembly System Interface:
In 2020, Node.js added experimental support for WebAssembly System Interface (WASI). This means that if you are running a recent version of Node.js, you can natively start a WASI instance and execute WebAssembly modules in a sandboxed environment, and granularly pass environment variables, arguments, or file handles to the process running in the module.
To learn more, you can check this article.
7) QUIC Protocol:
This new experimental UDP-based transport protocol is intended to ultimately replace the use of TCP for all HTTP traffic.
UDP is notoriously unreliable, with packets frequently being lost, reordered, duplicated, and so forth. UDP does not include any of the reliability and sequencing guarantees of TCP that are strictly required for a higher-level protocol such as HTTP. That is where QUIC comes in.
The QUIC protocol defines a layer on top of UDP that introduces error handling, reliability, flow control, and built-in security (via TLS 1.3) to UDP. And it’s super useful because QUIC introduces Inherent Flexibility, Security & Reduced Latency.
You can find more in this blog post..
Find out more here.
Node.js v 14 which was released in April, brought AsyncLocalStorage support.
Because Node is single threaded, you do not have the benefits of thread local storage, so to store data in asynchronous contexts we can use AsyncLocalStorage. To learn more about this topic you can read this great article here.
4) Node.js crashes on unhandledRejections by default! (v15 onwards):
Before when you had an unhandled Rejection, your node.js application will still be running and it will just show a warning message like this:
This is not a good practice because you can just ignore that error and that can potentially cause problems later and bring unexpected results.
Now, from Node.js version 15 onwards, if you have an unhandled rejection your application will automatically crash, this is a default best practice because now all unhandled rejections will be addressed (not just ignored) and it will avoid future problems.
3) Event Loop Utilization:
Event Loop Utilization (or ELU) is crucial to see if an application is reaching hardware limitations. The simplest definition of event loop utilization (or ELU) is the ratio of time the event loop is not idling in the event provider to the total time the event loop is running.
This is quite a complex feature, but you can check out this amazing blog post to learn more.
2) ECMAScript Modules became stable:
In 2017, ECMAScript Modules was introduced to Node.js as an experimental feature. This year it finally became stable, so you don’t have to use the experimental flag (--experimental-modules) anymore.
You can find more information in this article..
1) As always the awesome community:
There has been a great and a ton of work done in Node.js this year. As we saw there were major features and implementations added to Node.js. and this wouldn’t have been possible without the amazing community that supports the project. Thank you for all you do and we hope the project will keep growing and being used by millions of people.
If you think we missed something that should be in the top 10, send us a DM! Very excited about what the next year will bring!
One Last Thing...