Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-linkchecker

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-linkchecker

Find broken links and broken fragments

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Build Status Dependency Status devDependency Status

Linkchecker

Detect broken links and broken fragments

Installation

npm install node-linkchecker

Usage

.check(url[, options])

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

  • url: the url you want to check
  • options: provide that parameter if you want to override the default options. See below for more details

Example:

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

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

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

Options

optiondescriptiondefault
schemesan array of schemes you want to check["http:", "https:"]
userAgentthe user agent to be used for each requestnode-linkchecker
fragmentswhether to look for broken fragments or nottrue

TODO list

  • add support for robot exclusions
  • handle base href
  • improve result feedback and format
  • add tests

Keywords

FAQs

Package last updated on 14 Mar 2016

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

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