The NPM 7.0 package manager is now available

Published release of the package manager NPM 7.0, included with Node.js and used for distributing modules in JavaScript. The NPM repository serves over 1.3 million packages utilized by around 12 million developers. Approximately 75 billion downloads are recorded each month. NPM 7.0 is the first significant release formed after the acquisition of NPM Inc by GitHub. The new version will be included in the upcoming release of the Node.js 15, expected on October 20. To install NPM 7.0 without waiting for the new version of Node.js, you can run the command 'npm i -g npm@7'.

Key innovations:

  • Workspaces (Workspaces) allow you to aggregate dependencies from multiple packages into a single package for installation in one step.
  • Automatic installation peer dependencies (used in plugins to define the base packages that the current package is designed to work with, even if it is not directly used in it). Peer dependencies are specified in the package.json file under the 'peerDependencies' section. Previously, such dependencies were manually installed by developers, but NPM 7.0 has implemented an algorithm ensuring that a correctly defined peer dependency is found at the same level or higher than the dependent package in the node_modules tree.
  • The second version of the lockfile format (package-lock v2) and support for the yarn.lock lockfile. The new format enables reproducible builds and includes everything needed for a complete package tree assembly. NPM can now also use yarn.lock files as a source of package metadata and lock information.
  • Significant refactoring of internal components has been conducted, aimed at separating functionality to simplify maintenance and increase reliability. For example, the code for inspecting and managing the node_modules tree has been moved to a separate module Arborist.
  • . Transition to using the package.exports field has been completed, making it impossible to import internal modules via require().
  • The npxpackage has been completely rewritten and now uses the 'npm exec' command to run executables from packages.
  • The output of the 'npm audit' command has been significantly changed, both in human-readable format and in the '--json' mode.

Source: opennet.ru

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