New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diffjam

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diffjam - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

45

index.js

@@ -49,2 +49,13 @@ #!/usr/bin/env node

const logBreachError = async breach => {
console.error(
`${RED_X} ${chalk.red.bold(breach.name)}: ${breach.result} (expected ${
breach.quest.baseline
} or ${breach.quest.minimize ? "less" : "more"})`
);
if (breach.quest.description) {
console.error("", breach.quest.description);
}
};
async function postMetrics(apiKey, successes, breaches) {

@@ -151,7 +162,19 @@ let response;

}
if (failed || !questIsInGuardMode(quest)) {
logQuestResult(name, quest, result, Date.now() - questStart.getTime());
if (failed) {
// policy failed
logBreachError(_.last(breaches));
} else {
// policy is okay
if (!questIsInGuardMode(quest)) {
logQuestResult(
name,
quest,
result,
Date.now() - questStart.getTime()
);
}
}
})
);
console.log("\n");
return {

@@ -173,3 +196,2 @@ successes,

if (breaches.length) {
breaches.map(logBreachError);
logCheckFailedError();

@@ -187,3 +209,2 @@ process.exitCode = 1;

if (breaches.length) {
breaches.map(logBreachError);
logCheckFailedError();

@@ -494,14 +515,2 @@ }

const logBreachError = async breach => {
console.error(
"\n",
`${RED_X} ${chalk.red.bold(breach.name)}: ${breach.result} (expected ${
breach.quest.baseline
} or ${breach.quest.minimize ? "less" : "more"})`
);
if (breach.quest.description) {
console.error("", breach.quest.description, "\n\n");
}
};
const actionCinch = async questName => {

@@ -530,6 +539,4 @@ ensureConfig();

if (results.breaches.length > 0) {
const [firstBreach] = results.breaches;
logBreachError(firstBreach);
console.error(
"Cannot cinch a metric that doesn't even meet the baseline. \n"
chalk.bold("Cannot cinch a metric that doesn't even meet the baseline. \n")
);

@@ -536,0 +543,0 @@ process.exitCode = 1;

{
"name": "diffjam",
"version": "0.0.2",
"version": "0.0.3",
"description": "cli for diffjam.com",

@@ -5,0 +5,0 @@ "main": "index.js",

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