Skip to content
This repository has been archived by the owner on Mar 31, 2018. It is now read-only.

gabrielmangiurea/brkn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Related

License

MIT © Gabriel Mangiurea

About

[NO LONGER MAINTAINED] Yet another broken link checker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published