Today, the simultaneous release of Node.js v10 (LTS) and NPM v6. This event is especially important, it marks a new milestone for the entire platform and introduces many significant changes and improvements in the entire Node.js codebase. Added support for new encryption algorithms.
The tenth version of Node.js in October will receive long-term support, which will end in 2021.
The N-API has gone out of testing and is now stable. For those who do not know the N-API, this is an interlayer between your C ++ code and Node.js internals. Now, when changing versions, your modules will not have to be rewritten. Now it will be easier for developers using native modules to switch between Node.js versions. And maybe we will see fewer abandoned C ++ modules, the authors of which refused to support because of its complexity.
Node.js is now independent of the JS virtual machine, so the release of Node.js with Chakra Core under the hood is possible soon.
This version includes support for OpenSSL 1.1.0, now developers will be able to encrypt using ChaCha20 and authorize with Poly-1305. Also, OpenSSL is now connected via the N-API, which means that with the release of version 1.1.1 at the end of April TLS 1.3 (the new simplified and accelerated version of TLS) will be available.
As I wrote earlier, asynchronous loops and the new ReadStream behavior will become available in this version. In short, you can now loop through an iterator that returns promises, automatically waiting for their resolution:
for await (const chunk of fs.createReadStream(filepath)) { // ... }
Error#code
codes Error#code
codes have been entered that will allow not to be attached to the message text to determine their type. So now error handling will become more predictable.
Version v8 updated to 6.6. In which there are also many innovations:
Array#reduce
up to 10 times, executing asynchronous code and asynchronous loops in particular.String#trimStart
, String#trimEnd
. try { doSomethingWrongWay(); } catch { // !.. }
Read more in the v8 blog .
Promises are added to the fs
module. While experimentally in property promises
.
Improved support for performance measurement. And much more.
The official announcement [EN].
In the sixth version of NPM preoccupied security modules. Added support for vulnerability warnings when installing packages, as well as a new npm method:
npm audit
NPM will be automatically traversed through the database of known vulnerabilities and will warn you if a vulnerable module is encountered among the dependencies.
The package manager can deliver up to 17 times faster speed than the previous version. As well as the already accelerated npm ci
began to work 2-3 times faster.
Two years ago, NPM introduced webhooks support to receive notifications about a specific package change. Previously, a third-party wombat module was used for management, now support for webchuk has become integrated.
There was an automatic resolution of conflicts in lock-files. Also, more data is now displayed to determine the integrity of the packets.
Node.js can be downloaded from the official site (shipped with npm 5.6).
Install NPM:
npm i -g npm@6
Source: https://habr.com/ru/post/354234/
All Articles