https://github.com/jeysal/peer-compatible
Find versions of a package that work with given peer dependencies
https://github.com/jeysal/peer-compatible
compatible dependency package peer semver version
Last synced: 7 months ago
JSON representation
Find versions of a package that work with given peer dependencies
- Host: GitHub
- URL: https://github.com/jeysal/peer-compatible
- Owner: jeysal
- License: mit
- Created: 2017-06-11T15:50:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-25T23:27:31.000Z (about 8 years ago)
- Last Synced: 2025-02-16T20:03:47.842Z (8 months ago)
- Topics: compatible, dependency, package, peer, semver, version
- Language: JavaScript
- Size: 88.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# peer-compatible
> Find versions of a package that work with given peer dependencies
[](https://travis-ci.org/jeysal/peer-compatible)
[](https://ci.appveyor.com/project/jeysal/peer-compatible)
[](https://codecov.io/gh/jeysal/peer-compatible)[](https://www.npmjs.com/package/peer-compatible)
[](https://github.com/jeysal/peer-compatible/blob/master/LICENSE)## Installation
npm install --save peer-compatible
## Usage
```javascript
const compatible = require('peer-compatible').default;
```## API
### index
Finds versions of pkgName that work with given peers.
Given extra peers that the package does not require at all are considered to be compatible.**Parameters**
- `pkgName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The package to search for.
- `peers` **{}** The peers that found versions need to be compatible with,
formatted like a regular peer dependency object literal.
Versions must be exact, ranges are not supported.**Examples**
```javascript
peerCompatible('some-component-lib', { 'some-framework-core-lib': '1.0.0' })
.then(versions => console.log(versions));
```Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>>** The versions of the package that work with given peers.
## CLI version
[peer-compatible-cli](https://github.com/jeysal/peer-compatible-cli)