Socket
Book a DemoInstallSign in
Socket

peer-version-check

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peer-version-check

Check whether every peerDependency is defined as a devDependency

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
6
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

peer-version-check Build Status

Check whether every peerDependency is defined as a devDependency

As we all know, npm 3 changed to not install peerDependencies automatically. peerDependencies are still be useful and used by many package authors these days.

As a package author it's quite anoying during development that peerDependencies are not installed automacily anymore. There is an open feature request in the yarn repostiroy to allow install peerDependencies during development.

Recently one of my colleague suggested me to add them as devDependencies. Obviously duplicating is not the best solution, but it works. However there is a risk that they can get out of sync easily. To solve this issue, I wrote this CLI which checks if every peerDependency is defined as a devDependency with the same semver range.

Install

$ npm install peer-version-check

Usage

On travis-ci

before_script:
  npx peer-version-check

Command line

$ peer-version-check <path-to-package.json> (optional)

Example

$ peer-version-check ./package.json

Expected devDependency 'lodash' to be:
    ^4.0.0
Found:
    ^3.0.0

Exits with code 0 if every peerDependency is defined as a devDependency with the same semver range. If not exits with code 1 and an error message.

Common npm mistakes - Excellent article to read

License

MIT © Stefan Buck

Keywords

devDependency

FAQs

Package last updated on 03 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts