Need help with linkinator?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

531 Stars 36 Forks MIT License 178 Commits 16 Opened issues


🐿 Scurry around your site and find all those broken links.

Services available


Need anything else?

Contributors list

🐿 linkinator

A super simple site crawler and broken link checker.

npm version Build Status codecov Known Vulnerabilities Code Style: Google semantic-release

Behold my latest inator! The

provides an API and CLI for crawling websites and validating links. It's got a ton of sweet features:
  • 🔥 Easily perform scans on remote sites or local files
  • 🔥 Scan any element that includes links, not just
  • 🔥 Supports redirects, absolute links, relative links, all the things
  • 🔥 Configure specific regex patterns to skip
  • 🔥 Scan markdown files without transpilation


npm install linkinator

Not into the whole node.js or npm thing? You can also download a standalone binary that bundles node, linkinator, and anything else you need. See releases.

Command Usage

You can use this as a library, or as a CLI. Let's see the CLI!

$ linkinator LOCATIONS [ --arguments ]

Positional arguments

  Required. Either the URLs or the paths on disk to check for broken links.
  Supports multiple paths, and globs.


      The number of connections to make simultaneously. Defaults to 100.

    Path to the config file to use. Looks for `linkinator.config.json` by default.

    Include an automatic directory index file when linking to a directory.
    Defaults to 'false'.

--format, -f
    Return the data in CSV or JSON format.

    Show this command.

--include, -i
    List of urls in regexy form to include.  The opposite of --skip.

    Automatically parse and scan markdown if scanning from a location on disk.

--recurse, -r
    Recursively follow links on the same root domain.

    Automatically retry requests that return HTTP 429 responses and include
    a 'retry-after' header. Defaults to false.

    When scanning a locally directory, customize the location on disk
    where the server is started.  Defaults to the path passed in [LOCATION].

--skip, -s
    List of urls in regexy form to not include in the check.

    Request timeout in ms.  Defaults to 0 (no timeout).

    Override the default verbosity for this command. Available options are
    'debug', 'info', 'warning', 'error', and 'none'.  Defaults to 'warning'.

Command Examples

You can run a shallow scan of a website for busted links:

npx linkinator

That was fun. What about local files? The linkinator will stand up a static web server for yinz:

npx linkinator ./docs

But that only gets the top level of links. Lets go deeper and do a full recursive scan!

npx linkinator ./docs --recurse

Aw, snap. I didn't want that to check those links. Let's skip em:

npx linkinator ./docs --skip


parameter will accept any regex! You can do more complex matching, or even tell it to only scan links with a given domain:
linkinator --skip '^(?!'

Maybe you're going to pipe the output to another program. Use the

option to get JSON or CSV!
linkinator ./docs --format CSV

Let's make sure the
in our repo doesn't have any busted links:
linkinator ./ --markdown

You know what, we better check all of the markdown files!

linkinator "**/*.md" --markdown

Configuration file

You can pass options directly to the

CLI, or you can define a config file. By default,
will look for a
file in the current working directory.

All options are optional. It should look like this:

  "format": "json",
  "recurse": true,
  "silent": true,
  "concurrency": 100,
  "timeout": 0,
  "markdown": true,
  "directoryListing": true,
  "skip": ""

To load config settings outside the CWD, you can pass the

flag to the
linkinator --config /some/path/your-config.json

GitHub Actions

You can use

as a GitHub Action as well, using JustinBeckwith/linkinator-action:
      - main
name: ci
    runs-on: ubuntu-latest
      - uses: actions/[email protected]
      - uses: JustinBeckwith/[email protected]

To see all options or to learn more, visit JustinBeckwith/linkinator-action.

API Usage


Asynchronous method that runs a site wide scan. Options come in the form of an object that includes:

  • path
    (string|string[]) - A fully qualified path to the url to be scanned, or the path(s) to the directory on disk that contains files to be scanned. required.
  • concurrency
    (number) - The number of connections to make simultaneously. Defaults to 100.
  • port
    (number) - When the
    is provided as a local path on disk, the
    on which to start the temporary web server. Defaults to a random high range order port.
  • recurse
    (boolean) - By default, all scans are shallow. Only the top level links on the requested page will be scanned. By setting
    , the crawler will follow all links on the page, and continue scanning links on the same domain for as long as it can go. Results are cached, so no worries about loops.
  • retry
    (boolean|RetryConfig) - Automatically retry requests that respond with an HTTP 429, and include a
    header. The
    option is a placeholder for fine-grained controls to be implemented at a later time, and is only included here to signal forward-compatibility.
  • serverRoot
    (string) - When scanning a locally directory, customize the location on disk where the server is started. Defaults to the path passed in
  • timeout
    (number) - By default, requests made by linkinator do not time out (or follow the settings of the OS). This option (in milliseconds) will fail requests after the configured amount of time.
  • markdown
    (boolean) - Automatically parse and scan markdown if scanning from a location on disk.
  • linksToSkip
    (array | function) - An array of regular expression strings that should be skipped, OR an async function that's called for each link with the link URL as its only argument. Return a Promise that resolves to
    to skip the link or
    to check it.
  • directoryListing
    (boolean) - Automatically serve a static file listing page when serving a directory. Defaults to


Constructor method that can be used to create a new

instance. This is particularly useful if you want to receive events as the crawler crawls. Exposes the following events:
  • pagestart
    (string) - Provides the url that the crawler has just started to scan.
  • link
    (object) - Provides an object with
    • url
      (string) - The url that was scanned
    • state
      (string) - The result of the scan. Potential values include
      , or
    • status
      (number) - The HTTP status code of the request.


Simple example

const link = require('linkinator');

async function simple() { const results = await link.check({ path: '' });

// To see if all the links passed, you can check passed console.log(Passed: ${results.passed});

// Show the list of scanned links and their results console.log(results);

// Example output: // { // passed: true, // links: [ // { // url: '', // status: 200, // state: 'OK' // }, // { // url: '', // status: 200, // state: 'OK' // } // ] // } } simple();

Complete example

In most cases you're going to want to respond to events, as running the check command can kinda take a long time.

const link = require('linkinator');

async function complex() { // create a new LinkChecker that we'll use to run the scan. const checker = new link.LinkChecker();

// Respond to the beginning of a new page being scanned checker.on('pagestart', url => { console.log(Scanning ${url}); });

// After a page is scanned, check out the results! checker.on('link', result => {

// check the specific url that was scanned
console.log(`  ${result.url}`);

// How did the scan go?  Potential states are `BROKEN`, `OK`, and `SKIPPED`
console.log(`  ${result.state}`);

// What was the status code of the response?
console.log(`  ${result.status}`);

// What page linked here?
console.log(`  ${result.parent}`);


// Go ahead and start the scan! As events occur, we will see them above. const result = await checker.check({ path: '', // port: 8673, // recurse: true, // linksToSkip: [ // '', // '' // ] });

// Check to see if the scan passed! console.log(result.passed ? 'PASSED :D' : 'FAILED :(');

// How many links did we scan? console.log(Scanned total of ${result.links.length} links!);

// The final result will contain the list of checked links, and the pass/fail const brokeLinksCount = result.links.filter(x => x.state === 'BROKEN'); console.log(Detected ${brokeLinksCount.length} broken links.); }


Tips & Tricks

Using a proxy

This library supports proxies via the

environment variables. This guide provides a nice overview of how to format and set these variables.


You may have noticed in the example, when using a glob the pattern is encapsulated in quotes:

linkinator "**/*.md" --markdown

Without the quotes, some shells will attempt to expand the glob paths on their own. Various shells (bash, zsh) have different, somewhat unpredictable behaviors when left to their own devices. Using the quotes ensures consistent, predictable behavior by letting the library expand the pattern.


Oftentimes when a link fails, it's an easy to spot typo, or a clear 404. Other times ... you may need more details on exactly what went wrong. To see a full call stack for the HTTP request failure, use

--verbosity DEBUG
linkinator --verbosity DEBUG

Controlling Output


flag offers preset options for controlling the output, but you may want more control. Using
--format JSON
- you can do just that!
linkinator --verbosity DEBUG --format JSON | jq '.links | .[] | select(.state | contains("BROKEN"))'



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.