# peerdep

> An alternative peer dependency warning system

Latest version **0.1.0** (published 2014-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install peerdep
pnpm add peerdep
yarn add peerdep
bun add peerdep
```

Provides the command `peerdep`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-07-25 |
| First published | 2014-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Kyle Robinson Young |
| Maintainers | shama |
| Keywords | peerdeps, peer, dependencies |

## Links

- npm: https://www.npmjs.com/package/peerdep
- Repository: https://github.com/shama/peerdep
- Issues: https://github.com/shama/peerdep/issues
- npm.io page: https://npm.io/package/peerdep

## Dependencies (3)

- [npmlog](https://npm.io/package/npmlog.md) ^0.1.1
- [semver](https://npm.io/package/semver.md) ^3.0.1
- [parents](https://npm.io/package/parents.md) ^1.0.0

## Recent versions

- 0.1.0 (latest) — 2014-07-25

## README

# peerdep

> A warning system for peer dependencies.

`peerDependencies` may become removed from npm but that doesn't mean modules won't have peer dependencies. Any time a module accepts a plugin a peer dependency has been created. This library will help you warn users when they have not installed a compatible peer dependency.

[![NPM](https://nodei.co/npm/peerdep.png?downloads=true)](https://nodei.co/npm/peerdep/)

## usage

Install with `npm install peerdep --save` and then in your module/plugin's `package.json`, define your `peerDependencies` as normal but include this `peerdep` install script:

```json
{
  "name": "my-plugin",
  "version": "0.1.0",
  "scripts": {
    "install": "peerdep"
  },
  "peerDependencies": {
    "grunt": "~0.4.1"
  },
  "dependencies": {
    "peerdep": "~0.1.0"
  }
}
```

Now when your plugin has been installed it will run the `peerdep` script to check if a compatible version of `grunt@~0.4.1` has been installed. If it has not been installed or an incompatible version has been installed `peerdep` will log a warning to the user upon `npm install`:

```shell
WARN peerinvalid Peer my-plugin@0.1.0 wants grunt@~0.4.1 but found "grunt@0.3.0" installed.
```

### Alternative `peerDependencies` key

The first argument of the `peerdep` script is an alternate key if you want to avoid conflicts with the existing `peerDependencies` key:

```json
{
  "name": "my-plugin",
  "version": "0.1.0",
  "scripts": {
    "install": "peerdep myPeerDependencies"
  },
  "myPeerDependencies": {
    "grunt": "~0.4.1"
  },
  "dependencies": {
    "peerdep": "~0.1.0"
  }
}
```

## Release History
* 0.1.0 - initial release

## License
Copyright (c) 2014 Kyle Robinson Young  
Licensed under the MIT license.

---
_Source: https://npm.io/package/peerdep · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
