npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@waylay/ssblc

v0.5.6

Published

Static Site Broken Link Chacker: A broken-link checker for static sites, like the ones generated with docsify

Downloads

296

Readme

@waylay/ssblc

Static Site Broken Link Checker

CI Status Badge

A broken-link checker for static sites, like the ones generated with docsify that can get used, for example, for CI purposes on docsify docs (this is what I've developed it for).

It recursively checks internal links found on the static website (until every internal link is checked) and (without recursion) outgoing links. This is achieved by finding href attributes in the HTML, meaning also stylesheets included with <link href="some-file.css"> get checked.

Installation

You can either run it by just using npx, in which case you won't have to install it, or first install it with

npm install -g @waylay/ssblc

Usage

When you are in the folder of your static website (i.e., there is an index.html in this folder), simply run

ssblc

after which the checker will begin its work.

To use it with npx, simply run

npx @waylay/ssblc

Alternatively, you can also specify an absolute or relative path to the directory of the site, e.g., like this:

ssblc --dir ../my-site

If not present, the checker will use the current working directory as the base directory.

Additional Options

--context [file]

Loads a JSON file with context variables for link replacement. The file should contain a JSON object with the following structure:

{
  "vars": {
    "some-key": "some-value",
    "another-key": "another-value"
  }
}

The context variables can be used in the href attributes of the HTML, e.g., <a href="{{vars.some-key}}">Some Link</a>.

--max-concurrent-checks [number]

Sets the maximum number of concurrent checks (default: 5).

--protocol-timeout [milliseconds]

Sets the protocol timeout for Puppeteer (default: 30000 ms).

--page-load-timeout [milliseconds]

Sets the page load timeout for Puppeteer (default: 30000 ms).

--port [number]

Sets the port number for the local server (default: 3000).

--ignore-statuses [statuses]

Comma-separated list of HTTP statuses to ignore (e.g., 401,403).

--dry-run

If present, exit with code 0 even if errors are found.

Examples

Check a static site in the current working directory

ssblc

Check a static site in a different directory

ssblc --dir ../my-site

Check a static site with context variables

ssblc --context context.json

Check a static site using a different port number

ssblc --port 8080

Check a static site using a different protocol timeout

ssblc --protocol-timeout 60000

Check a static site using a different page load timeout

ssblc --page-load-timeout 60000

Check a static site using a different maximum number of concurrent checks

ssblc --max-concurrent-checks 10

Check a static site with ignored HTTP statuses

ssblc --ignore-statuses 401,403

Check a static site and exit with code 0 even if errors are found

ssblc --dry-run