w3c/node-linkchecker

Name: node-linkchecker

Owner: World Wide Web Consortium

Description: Detect broken links and broken fragments

Created: 2016-02-17 10:49:26.0

Updated: 2017-12-17 09:14:25.0

Pushed: 2016-03-14 12:12:38.0

Homepage:

Size: 19

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Dependency Status devDependency Status

Linkchecker

Detect broken links and broken fragments

Installation
install node-linkchecker
Usage
.check(url[, options])

Find broken links and optionally broken fragments on a given url. Parameters:

Example:

nlc = require('./lib/node-linkchecker');
check("http://www.example.org/").then(function(result) {
(result.brokenLinks.length > 0) {
console.log('the document contains broken links');

(result.brokenFragments.length > 0) {
console.log('the document contains broken fragments');




nlc = require('./lib/node-linkchecker')
options = {
  schemes: ["https:"],
  userAgent: "W3C node linkchecker",
  fragments: false
};

check("https://www.example.org/", options)
then(function(result) {
 // { brokenLinks: [], brokenFragments: [] }
, function(err) {
 console.log('rejection');
);
Options

| option | description | default | | ————- | ——————————————- | ——————— | | schemes | an array of schemes you want to check | ["http:", "https:"] | | userAgent | the user agent to be used for each request | node-linkchecker | | fragments | whether to look for broken fragments or not | true |

TODO list

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.