Node.js 24.0.0 platform released

Node.js 24.0.0, a platform for running network applications in JavaScript, has been released. Node.js 24.0 is classified as a long-term support branch, but this status will be assigned only in October, after stabilization. Node.js 24.x will be supported until April 30, 2028. The previous LTS branch Node.js 22.x will be supported until April 2027, and the previous LTS branch 20.x until April 2026. Maintenance of the LTS branch 18.x ended on April 30, 2025, and the intermediate branch Node.js 23.x will be stopped on June 1, 2025.

Main improvements:

  • The AsyncLocalStorage API uses the AsyncContextFrame class by default, which is marked as stable. AsyncContextFrame implements a more efficient mechanism for tracking asynchronous context, which can significantly improve performance.
  • The URLPattern API is now available as a global object that can be used without explicit import. URLPattern provides capabilities for checking whether a URL matches a specific pattern, which can be used for parsing links, for example.
  • Improved and stabilized the Permission Model mechanism, which allows you to restrict access to certain resources during execution (for example, you can prohibit the creation of child processes, restrict write or read access to certain parts of the FS, disable extensions). Instead of the experimental flag "--experimental-permission" to enable the Permission Model, you can now use the flag "--permission".
  • The node:test (test_runner) module, designed to create and run JavaScript tests that return results in the TAP (Test Anything Protocol) format, has been expanded. The module now automatically waits for nested tests to complete without the need to use await.
  • The undici HTTP client has been updated to the 7.x branch, which improves performance and adds support for new HTTP features.
  • The V8 engine has been updated to version 13.6, used in Chromium 136. New features compared to the previous Node.js release include support for typed Float16Array arrays, manual resource management, the RegExp.escape method (escaping strings for RegExp), 64-bit pointers (Memory64) in WebAssembly, and the Error.isError method.
  • The NPM package manager has been updated to version 11.
  • MSVC compiler support has been discontinued. ClangCL must be used for compilation on Windows.

The Node.js platform can be used both for server-side support of web applications and for creating standard client- and server-side network programs. To expand the functionality of Node.js applications, a large collection of modules has been prepared, including those implementing servers and clients of HTTP, SMTP, XMPP, DNS, FTP, IMAP, POP3, modules for integration with various web frameworks, WebSocket and Ajax handlers, connectors to DBMS (MySQL, PostgreSQL, SQLite, MongoDB), template engines, CSS engines, implementations of cryptographic algorithms and authorization systems (OAuth), XML parsers.

To handle a large number of parallel requests, Node.js uses an asynchronous code execution model based on non-blocking event processing and defining callback handlers. The supported methods for connection multiplexing are epoll, kqueue, /dev/poll, and select. The libuv library, which is an add-on to libev on Unix systems and to IOCP on Windows, is used for connection multiplexing. The libeio library is used to create a thread pool, and c-ares is integrated to perform DNS queries in non-blocking mode. All system calls that cause blocking are executed inside the thread pool and then, like signal handlers, pass the result of their work back through an unnamed pipe.

Execution of JavaScript code is ensured through the use of the V8 engine developed by Google (in addition, Microsoft is developing a version of Node.js with the Chakra-Core engine). At its core, Node.js is similar to the Perl AnyEvent, Ruby Event Machine, Python Twisted frameworks and the implementation of events in Tcl, but the event loop in Node.js is hidden from the developer and resembles event processing in a web application running in browser.

Source: opennet.ru

Add a comment