The server-side JavaScript platform Node.js 19.0 is now available.

The release of Node.js 19.0 has taken place, a platform for running network applications in JavaScript. Node.js 19 is classified under the standard support branch, with updates to be released until June 2023. In the coming days, the stabilization of the Node.js 18 branch will be completed, which will achieve LTS status and will be supported until April 2025. Support for the previous LTS branch, Node.js 16.0, will last until September 2023, and for the one before that, Node.js 14.0, until April 2023.

Key Improvements:

  • The V8 engine has been updated to version 10.7, used in Chromium 107. Notable changes in the engine compared to the Node.js 18 branch include the implementation of the third version of the API Intl.NumberFormat, which adds new functions formatRange(), formatRangeToParts(), and selectRange(), set grouping, new rounding options, and the ability to interpret strings as decimal numbers. Included dependencies also include llhttp 8.1.0 and npm 8.19.2.
  • An experimental command "node --watch" has been introduced, implementing a watch mode that restarts the process when an imported file changes (for example, executing "node --watch index.js" will automatically restart the process when index.js is modified).
  • Support for the HTTP 1.1 Keep-Alive mechanism has been enabled for all outgoing HTTP/HTTPS connections, keeping the connection open for a certain time to handle multiple HTTP requests over a single connection. It is expected that using Keep-Alive will increase throughput and performance. By default, the timeout to keep the connection open is set to 5 seconds. Support for parsing the Keep-Alive HTTP header in responses has been added to the HTTP client implementation, server, and support for automatically disconnecting inactive clients using Keep-Alive has been added to the Node.js HTTP server implementation.
  • The WebCrypto API has been promoted to stable, with the exception of functions using the Ed25519, Ed448, X25519, and X448 algorithms. The WebCrypto module can now be accessed using globalThis.crypto or require('node:crypto').webcrypto.
  • Support for the DTrace, SystemTap, and ETW (Event Tracing for Windows) tracing frameworks has been removed, as maintaining them in an up-to-date manner was deemed impractical due to the lack of a proper support plan.

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

To handle a large number of parallel requests, Node.js utilizes an asynchronous code execution model based on event-driven non-blocking I/O and the definition of callback handlers. Multiplexing methods such as epoll, kqueue, /dev/poll, and select are supported for connection multiplexing. The libuv library is used for connection multiplexing, which is a wrapper around libev on Unix systems and IOCP on Windows. The libeio library is employed to create a thread pool, while c-ares is integrated for non-blocking DNS requests. All blocking system calls are executed within the thread pool, and like signal handlers, they pass their results back through an unnamed pipe. JavaScript code execution is ensured through the use of the V8 engine developed by Google (additionally, Microsoft develops a version of Node.js with the Chakra-Core engine).

Essentially, Node.js is similar to the Perl AnyEvent, Ruby Event Machine, Python Twisted frameworks, and the event handling implementation in Tcl, but the event loop in Node.js is abstracted away from the developer and resembles the event processing in a web application running in a browser. When developing applications for Node.js, it is crucial to consider the specifics of event-driven programming. For example, instead of executing "var result = db.query('select...');" and waiting for its completion before processing the results, Node.js employs asynchronous execution, meaning the code is transformed into "db.query('select...', function (result) {process result});" allowing control to pass immediately to the subsequent code, with the query results processed as data arrives.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster