I recently discovered a broken-link-checker Javascript library that a few minutes later was identifying broken links that I was not aware of, in the project that I’ve been working on.
This blog article is about broken-link-checker, an NPM dependency that you can use to find broken links, missing images, and so on in your web application.
Prerequisites
NodeJS & NPM – Setup tutorial here
Installation
npm install -g broken-link-checker
Run
- scan only the links on the current page
blc https://qa-practice.netlify.app
- scan links recursively in the entire project (current page, other pages, and subpages; adding -ro flag)
blc https://qa-practice.netlify.app -ro
- exclude external domains (adding -e flag)
blc https://qa-practice.netlify.app -roe
- exclude specific domain URLs (e.g. Twitter and LinkedIn; using –exclude flag)
blc https://qa-practice.netlify.app -ro --exclude twitter --exclude linkedin
Note: For additional options, you can run
blc --help
Output

NOTE: you can use the tool as project dependency as well
I created a step by step tutorial HERE
If you liked this article, then please subscribe to my YouTube Channel for Test Automation video tutorials. You can also find me on LinkedIn and Twitter.