An open API service indexing awesome lists of open source software.

https://github.com/ssmirr/compatible

🛠📦Check how compatible two versions of a dependency are
https://github.com/ssmirr/compatible

dependancy-manager dependencies npm pip

Last synced: 2 months ago
JSON representation

🛠📦Check how compatible two versions of a dependency are

Awesome Lists containing this project

README

        

# Compatible 🛠📦

Tiny (has no dependencies) package to check how compatible a version of dependency is with another version.
This package gets the data from Dependabot which supports many languages (JavaScript, Python, Java, ...) and package managers (npm, pip, mvn, ...).

## Installation

Install latest release from npm:

``` shell
$ npm install compatible
```

Install latest updates from source:

``` shell
$ npm install ssmirr/compatible
```

## Using _Compatible_

You can fetch compatibility status of a package and all the versions:

``` js
await compatible.dependency('', '', ''));
```

, specific version of a package:

``` js
await compatible.update('', '', '', ''));
```

, or updating from version a to version b of a package:

``` js
await compatible.version('', '', ''));
```

## Example

``` js
const compatible = require('compatible');

(async () => {
console.log(await compatible.update('django', 'pip', '2.1.4', '2.1.5'))
console.log(await compatible.version('got', 'npm_and_yarn', '9.5.0'))
console.log(await compatible.dependency('got', 'npm_and_yarn', true))
})();

// results is a json object:
// [ { candidate_updates: 1,
// successful_updates: 0,
// previous_version: '1.10.3',
// updated_version: '1.11.7',
// non_breaking_if_semver: true
// success_rate: 0.94 } ]
```

> Note: `candidate_updates` is the number of pull requests Dependabot made, and `successful_updates` is how many were merged.