Created
February 28, 2018 17:25
-
-
Save euharrison/9db65a6b630ecb8da382eac80f016fc4 to your computer and use it in GitHub Desktop.
List peerDependencies for specific package version and above
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { execSync } = require('child_process'); | |
const packageName = 'react-hot-loader'; | |
const currentVersion = '1.3.0'; | |
const allVersions = eval(execSync(`npm view ${packageName} versions`).toString()); | |
const currentVersionIndex = allVersions.indexOf(currentVersion); | |
const forwardVersions = allVersions.slice(currentVersionIndex); | |
forwardVersions.forEach(version => { | |
const peer = execSync(`npm view ${packageName}@${version} peerDependencies`).toString(); | |
console.log(`[${packageName}@${version}] ${peer}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment