Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

check-deps-versions

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-deps-versions - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

26

index.js

@@ -25,2 +25,19 @@ const chalk = require('chalk');

const diffColorMap = { // Traffic light here :)
major: 'red',
minor: 'yellow',
patch: 'green'
};
const getDiff = (range, version) => {
if (range.indexOf(' ') !== -1) {
return '';
}
const rangeVersion = range.replace(/^[^0-9]+/, '');
const diff = semver.diff(rangeVersion, version);
return diffColorMap[diff] ? chalk[diffColorMap[diff]](diff) : diff;
};
const getPackageUpdates = (packageName, localRange) =>

@@ -42,3 +59,4 @@ packageJson(packageName).then(result => {

current: localRange,
latest: latestVersion
latest: latestVersion,
diff: getDiff(localRange, latestVersion)
};

@@ -75,3 +93,4 @@ }

chalk.red.underline('current'),
chalk.green.underline('latest')
chalk.green.underline('latest'),
''
];

@@ -90,3 +109,4 @@

updates[packageName].current,
updates[packageName].latest
updates[packageName].latest,
updates[packageName].diff
]));

@@ -93,0 +113,0 @@ const tableStr = table(rows, { stringLength: coloredStringLength });

2

package.json
{
"name": "check-deps-versions",
"version": "0.0.7",
"version": "0.0.8",
"description": "Check if dependencies specified in package.json are up to date with the latest available versions.",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc