1.0.6 • Published 3 years ago

converge-peer-dependencies v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

converge-peer-dependencies

Converge peer dependencies in package.json

Description

This tool can be applied on a NodeJS (or Babelized) project, after dependencies have been installed, to gather all peer dependencies of the dependencies in package.json, converge them, if possible, among themselves and the other dependencies, and add them back to package.json.

On success, it returns an object with existing dependencies that changed and new dependencies that were added.

{
  depChanged,
  depAdded
}

Usage

const { converge } = require('converge-peer-dependencies');

converge('./dir/to/app').then(ret => {
  console.log(JSON.stringify(ret, null, 2));
})
.catch(e => {
  console.log(JSON.stringify(e));
});

An optional options object can be provided as second argument, with the following structure.

optiondefaultdescriptionexample
matchernullboolean predicate on the package namen => !n.startsWith('react')