Node.js 15.0 Is Released
Networking. It makes the web work.
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.
String.prototype.replaceAll()and it makes it possible to use boolan assignment operators like
- 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-quicflag. 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.