Very fast link-checking.
- Fast crawling is key
You want to run the link-checker at least before every deploy (on CI or manually). When it takes ages, you're less likely to do so.
- linkcheck is currently several times faster than blc
- Finds everything important
No link-checker can guarantee correct results: the web is too flaky for that.
But at least the tool should correctly parse the HTML (not just try to guess what's a URL and what isn't) and the CSS (for
The tool already finds more than
blc, and it has fewer false positives.
- Sane defaults (easy things are easy, advanced things are possible)
The most frequent use cases should be only a few arguments. For example, unleashing
linkcheckon http://localhost:4001 can be done via
- You want to crawl a served site, not directories of files.
- Ignores throttling and robots.txt on localhost.
- Should follow CLI 'standards' (no
- Brief and meaningful output
- When everything works, all you want to see is 'Perfect' + stats.
When things are broken, you want to see where exactly is the problem and you want to have it sorted in a sane way.
- linkcheck does this.
- Useful status code
For CI build,
linkcheckreturns status code
1if there are warnings, and status code
2if there are errors.
Step 1. Install Dart
$ brew tap dart-lang/dart $ brew install dart
Step 2. Install
pub global activate linkcheck
If in doubt, run
linkcheck -h. Here are some examples to get you started.
Assuming you run your server on http://localhost:8000/, you can do:
linkcheck :8000to crawl the site and ignore external links
linkcheck :8000 -eto try external links
linkcheck www.example.comto crawl www.example.com and ignore external links
linkcheck https://www.example.comto start directly on https
linkcheck www.example.com www.other.comto crawl both sites and check links between the two (but ignore external links outside those two sites)
Assuming you have a text file
mysites.txt like this:
http://egamebook.com/ http://filiph.net/ https://alojz.cz/
You can run
linkcheck -i mysites.txt and it will crawl all of them and also
check links between them.