https://github.com/seancdavis/node-link-checker
Simple script that checks for broken links on a site and reports the results in the console
https://github.com/seancdavis/node-link-checker
links nodejs testing
Last synced: about 1 month ago
JSON representation
Simple script that checks for broken links on a site and reports the results in the console
- Host: GitHub
- URL: https://github.com/seancdavis/node-link-checker
- Owner: seancdavis
- Created: 2023-01-08T12:50:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T02:11:11.000Z (over 3 years ago)
- Last Synced: 2025-02-22T09:46:22.444Z (over 1 year ago)
- Topics: links, nodejs, testing
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Link Checker with Node.js
This is a simple script that recursively checks links on a URL and reports the results back to the console.
## Usage
If you're going to use this in your project, you may just want to copy the `index.js` code and install the appropriate dependencies.
npm install linkinator chalk
Or you can clone and work with this repo directly.
git clone https://github.com/seancdavis/node-link-checker.git
cd node-link-checker
npm install
### Setting the Base URL
The script looks for a `LINK_CHECKER_BASE_URL` environment variable which it uses as the first link to check, and then begins recursively scanning that page by following links on the same domain.
There is also a fallback URL set directly in the `index.js` script, which you can change.
## Contact
This was built as an example project to serve a blog post. I don't intend on maintaining or improving it. I've built more complex examples for use in production in other repositories.
If you have questions or find bugs, feel free to [send me a message](https://www.seancdavis.com/contact/).