🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

brkn

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brkn

Yet another broken link checker

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
2
-95.74%
Maintainers
1
Weekly downloads
 
Created
Source

brkn Build Status

Yet another broken link checker.

Install

$ npm install --save brkn

Usage

const brkn = require('brkn');

// execute the function
brkn(['https://your.website.here/somepage.html'], ['href'], 'https://your.website.here', {verbose: false});

// then listen for the 'end' event
brkn.events.on('end', function(brokenUrls) {
  console.log('Broken URLs:', brokenUrls);
  //=> 'Broken URLs: [...]'
});

API

brkn(sources, attributes, baseUrl, [opts])

Emits an end event (type: Array) with the inaccessible URLs found in sources.

Will emit error event (type: String) on URL/File parsing errors.

sources

Type: Array

An array with the target web page(s) or file(s).

attributes

Type: Array

An array with the HTML attributes that brkn should scan.

base

Type: String

The hostname (with protocol) to which the relative URLs will resolve to.

options

verbose

Type: Boolean

If true, brkn will emit two additional events:

  • item
    • emitted: after each scanned URL
    • type: Object
    • params:
      • broken: Boolean
      • source: String
      • statusCode: Integer
      • url: String
  • source
    • emitted: after each completed source, when there are more than one
    • type: Object
    • params:
      • source: String
      • brokenUrls: Array

License

MIT © Gabriel Mangiurea

Keywords

broken

FAQs

Package last updated on 30 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts