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

linkinator

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkinator - npm Package Compare versions

Comparing version 3.1.0 to 4.0.0

41

build/src/cli.js

@@ -5,3 +5,2 @@ #!/usr/bin/env node

import chalk from 'chalk';
import jsonexport from 'jsonexport';
import fs from 'fs';

@@ -127,2 +126,6 @@ import { URL } from 'url';

const checker = new LinkChecker();
if (format === Format.CSV) {
const header = 'url,status,state,parent,failureDetails';
console.log(header);
}
checker.on('retry', (info) => {

@@ -147,2 +150,8 @@ logger.warn(`Retrying: ${info.url} in ${info.secondsUntilRetry} seconds.`);

}
if (format === Format.CSV) {
const showIt = shouldShowResult(link, verbosity);
if (showIt) {
console.log(`"${link.url}",${link.status},${link.state},"${link.parent || ''}","${link.failureDetails || ''}"`);
}
}
});

@@ -186,15 +195,3 @@ const opts = {

const result = await checker.check(opts);
const filteredResults = result.links.filter(link => {
switch (link.state) {
case LinkState.OK:
return verbosity <= LogLevel.WARNING;
case LinkState.BROKEN:
if (verbosity > LogLevel.DEBUG) {
link.failureDetails = undefined;
}
return verbosity <= LogLevel.ERROR;
case LinkState.SKIPPED:
return verbosity <= LogLevel.INFO;
}
});
const filteredResults = result.links.filter(link => shouldShowResult(link, verbosity));
if (format === Format.JSON) {

@@ -206,5 +203,2 @@ result.links = filteredResults;

else if (format === Format.CSV) {
result.links = filteredResults;
const csv = await jsonexport(result.links);
console.log(csv);
return;

@@ -314,3 +308,16 @@ }

}
function shouldShowResult(link, verbosity) {
switch (link.state) {
case LinkState.OK:
return verbosity <= LogLevel.WARNING;
case LinkState.BROKEN:
if (verbosity > LogLevel.DEBUG) {
link.failureDetails = undefined;
}
return verbosity <= LogLevel.ERROR;
case LinkState.SKIPPED:
return verbosity <= LogLevel.INFO;
}
}
main();
//# sourceMappingURL=cli.js.map
{
"name": "linkinator",
"description": "Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.",
"version": "3.1.0",
"version": "4.0.0",
"license": "MIT",

@@ -31,3 +31,2 @@ "repository": "JustinBeckwith/linkinator",

"htmlparser2": "^8.0.1",
"jsonexport": "^3.2.0",
"marked": "^4.0.3",

@@ -37,9 +36,7 @@ "meow": "^10.1.1",

"server-destroy": "^1.0.1",
"update-notifier": "^5.1.0"
"update-notifier": "^6.0.0"
},
"devDependencies": {
"@types/chai": "^4.2.22",
"@types/escape-html": "^1.0.1",
"@types/glob": "^7.2.0",
"@types/jsonexport": "^3.0.2",
"@types/marked": "^4.0.0",

@@ -51,8 +48,7 @@ "@types/mime": "^2.0.3",

"@types/sinon": "^10.0.6",
"@types/update-notifier": "^5.1.0",
"@types/update-notifier": "^6.0.0",
"c8": "^7.10.0",
"chai": "^4.3.4",
"codecov": "^3.8.2",
"execa": "^6.0.0",
"gts": "^3.1.0",
"gts": "^4.0.0",
"mocha": "^10.0.0",

@@ -67,3 +63,3 @@ "nock": "^13.2.1",

"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=14"
},

@@ -70,0 +66,0 @@ "files": [

Sorry, the diff of this file is not supported yet

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