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 2.0.2 to 2.0.3

15

build/src/index.d.ts
/// <reference types="node" />
import { EventEmitter } from 'events';
import PQueue, { DefaultAddOptions } from 'p-queue';
import { URL } from 'url';
import PriorityQueue from 'p-queue/dist/priority-queue';
export interface CheckOptions {

@@ -25,2 +28,11 @@ concurrency?: number;

}
interface CrawlOptions {
url: URL;
parent?: string;
crawl: boolean;
results: LinkResult[];
cache: Set<string>;
checkOptions: CheckOptions;
queue: PQueue<PriorityQueue, DefaultAddOptions>;
}
/**

@@ -53,3 +65,3 @@ * Instance class used to perform a crawl job.

*/
private crawl;
crawl(opts: CrawlOptions): Promise<void>;
}

@@ -64,1 +76,2 @@ /**

}>;
export {};

11

build/src/index.js

@@ -40,2 +40,5 @@ "use strict";

const results = new Array();
const url = new url_1.URL(options.path);
const initCache = new Set();
initCache.add(url.href);
queue.add(async () => {

@@ -47,3 +50,3 @@ await this.crawl({

results,
cache: new Set(),
cache: initCache,
queue,

@@ -85,7 +88,2 @@ });

async crawl(opts) {
// Check to see if we've already scanned this url
if (opts.cache.has(opts.url.href)) {
return;
}
opts.cache.add(opts.url.href);
// explicitly skip non-http[s] links before making the request

@@ -206,2 +204,3 @@ const proto = opts.url.protocol;

if (!opts.cache.has(result.url.href)) {
opts.cache.add(result.url.href);
opts.queue.add(async () => {

@@ -208,0 +207,0 @@ await this.crawl({

{
"name": "linkinator",
"description": "Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.",
"version": "2.0.2",
"version": "2.0.3",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "JustinBeckwith/linkinator",

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