Server-side JavaScript Node.js 13.0 release

Available Release Node.js 13.0, platforms for executing network applications in JavaScript. At the same time, the stabilization of the previous branch of Node.js 12.x was completed, which was moved to the category of long-term support releases, for which updates are released for 4 years. Support for the previous Node.js 10.0 LTS branch will last until April 2021, and the previous 8.0 LTS branch until January 2020.

All improvements:

  • V8 engine updated to version 7.8, which uses new performance optimization techniques, improved object destructuring, reduced memory consumption, and reduced WebAssembly runtime;
  • By default, full support for internationalization and Unicode based libraries is enabled. ICU (International Components for Unicode), which allows developers to write code that supporting work with different languages ​​and locales. The full-icu module is now installed by default;
  • API stabilized Workers Threads, allowing create multi-threaded event loops. The implementation is based on the worker_threads module, which allows you to run JavaScript code in multiple parallel threads. Stable support for the Workers Threads API is also backported to the Node.js 12.x LTS branch;
  • Platform requirements have been increased. To build now required at least macOS 10.11 (requires Xcode 10), AIX 7.2, Ubuntu 16.04, Debian 9, EL 7, Alpine 3.8, Windows 7/2008;
  • Support for Python 3 has been improved. If both Python 2 and Python 3 are present on the system, Python 2 is still used, but the ability to build with only Python 3 is added;
  • Removed the old HTTP parser implementation ("--http-parser=legacy"). Removed or deprecated calls and properties FSWatcher.prototype.start(), ChildProcess._channel, open() method in ReadStream and WriteStream objects, request.connection, response.connection, module.createRequireFromPath();
  • Next came out update 13.0.1, in which several bugs were fixed in hot pursuit. This includes an issue with npm 6.12.0 warning about an unsupported version being used.

Recall that the Node.js platform can be used both for server maintenance of Web applications and for creating ordinary client and server network programs. To extend the functionality of applications for Node.js, a large collection of modules, in which you can find modules with the implementation of HTTP, SMTP, XMPP, DNS, FTP, IMAP, POP3 servers and clients, modules for integration with various web frameworks, WebSocket and Ajax handlers, connectors to DBMS (MySQL, PostgreSQL, SQLite, MongoDB ), template engines, CSS engines, implementations of crypto algorithms and authorization systems (OAuth), XML parsers.

To ensure the processing of a large number of parallel requests, Node.js uses an asynchronous code execution model based on non-blocking event handling and the definition of callback handlers. Supported methods for multiplexing connections are epoll, kqueue, /dev/poll, and select. The library is used for multiplexing connections libuv, which is a superstructure over libev on Unix systems and over IOCP on Windows. The library is used to create a thread pool libeio, to perform DNS queries in non-blocking mode integrated c-ares. All system calls that cause blocking are executed inside the thread pool and then, like signal handlers, transfer the result of their work back through an unnamed pipe (pipe). The execution of JavaScript code is provided through the use of an engine developed by Google V8 (Additionally, Microsoft is developing a Node.js variant with the Chakra-Core engine).

At its core, Node.js is similar to frameworks. Perl AnyEvent, Ruby Event Machine, Python Twisted ΠΈ Implementation of events in Tcl, but the event loop in Node.js is hidden from the developer and resembles event handling in a web application running in a browser. When writing applications for node.js, you need to consider the specifics of event-driven programming, for example, instead of doing "var result = db.query("select..");" with waiting for completion of work and subsequent processing of results, Node.js uses the principle of asynchronous execution, i.e. the code is transformed into "db.query("select..", function (result) {result processing});", in which control will instantly pass to further code, and the query result will be processed as data arrives. .

Source: opennet.ru

Add a comment