npm install brkn> Yet another broken link checker.
```
$ npm install --save brkn
`javascript
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: [...]'
});
`
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:
- itemObject
- emitted: after each scanned URL
- type: Boolean
- params:
- broken: String
- source: Integer
- statusCode: String
- url: source
- Object
- emitted: after each completed source, when there are more than one
- type: String
- params:
- source: Array`
- brokenUrls:
- brkn-cli - CLI for this module
MIT © Gabriel Mangiurea