Node.js 15.0 Is Released

From LinuxReviews
Jump to navigationJump to search
Network-wired.png

Support for the QUIC protocol, a new AbortController class, a updated N-API with new methods for managing ArrayBuffers, V8 updated to version 8.6 and NPM updated to version 7.0 are among the highlights in the latest Node.js framework for creating JavaScript-based network services like web servers, chat servers and all kinds of real-time applications.

written by 윤채경 (Yoon Chae-kyung)  2020-10-24 - last edited 2020-10-24. © CC BY

Network-and-monitors.jpg
Networking. It makes the web work.

Node.js is a increasingly popular framework primarily used to make web servers serving websites written in JavaScript. It can be used to create a wide array of other kinds of network services.

Node.js 15.0 is a "regular" support release with support throughout June 2021. Node.js uses even numbers for LTS releases. The Node.js 14.x branch is the corrent "Long Term Support" branch with support throughout April 2023 and the older Node.js 12.x will be supported until April 2022. The 10.x branch will go EOL in April 2021.

Node.js 15.0 brings a series of useful improvements:

  • The N-API for developing Node.js add-ons has been updated with new methods for managing ArrayBuffers.
  • The V8 JavaScript and WebAssembly engine has been updated to version 8.6. This brings a lot of new features such as Promise.any(), AggregateError and String.prototype.replaceAll() and it makes it possible to use boolan assignment operators like &&=, ||= and ??=.
  • Node.js 15.0 has a experimental implementation of the AbortController class. This fits in with the client-side AbortController Web API.
  • Node.js 15.0 uses NPM 7.0 with all the new features that entails.
  • The net module has gotten experimental support for the QUIC (pronounced "quick") network protocol. QUIC is a transport-layer protocol designed by Google that uses multiplexed UDP connections instead of TCP. It's actually something a lot of people use without knowing it: Google Chrome supports it and more than half of all connections to Google's servers are made using teh QUIC protocol. QUIC is not enabled by default in Node.js 15.0, it has to be enabled with the --experimental-quic flag. See nodejs.org/dist/latest-v15.x/docs/api/quic.html if want to enable it and see how it works.

There's also one change developers should take note of: The unhandledRejection defaults to a "throw" exception instead of a "warn" warning. unhandledRejection will now through a "uncaught exception" error unless a handler for it is set. It is possible to get the old behavior by using a new --unhandled-rejections = warn flag.

You can find all kinds of modules for Node.js at npmjs.com if you want to use to create client or server programs. Web servers are the most common use-case, but it can do a lot more. There's modules implementing both server and client-side support for protocols like SMTP, XMPP, DNS, FTP, IMAP and POP3, connetors for all the popular databases (MySQL, postgreSQL, SQLite, MOngoDB), template engines, CSS engines, XML parsers and various authorization systems and a lot more developers can use to create almost any kind of network service using Node.js.

Node.js is entirely event-driver with asynchronous exection, so one needs to take that into account when writing programs for it. It's kind of similar to Python's Twisted engine, Ruby's Event Machine and Perl's AnyEvent in that regard.

The Node.js website is at nodejs.org. There's ample documentation at nodejs.org/en/docs/ and there's a wonderful educational website with a lot of installable tutorials you can use to learn the basics of it at nodeschool.io.

1.00
(one vote)


Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.