link_checker 1.1.0 link_checker: ^1.1.0 copied to clipboard
Finds links practically anywhere and optionally checks if they're dead
link_checker #
Finds links and can check if they're dead.
Are you tired of finding dead links in projects from READMEs to large websites? Yes, yes you are. link_checker
allows you to test for dead links, whether it be a single link, a file, or an entire project, all with a single line! It can check any type of file (except binaries obviously), from Java to Markdown. There are some cases where it won't parse properly of course. For example, Dart programs usually use single quotes to enclose strings, and since single quotes are also valid URL characters, it can easily fail falsely. However, Markdown files and the like are parsed just fine, so see which files you can test with this!
test('links', () {
expect(
getBadLinksInDirectory(blacklistedFiles: [
'pubspec.lock'
], blacklistedDirectories: [
BlacklistedDirectory('doc'),
BlacklistedDirectory('test'),
BlacklistedDirectory('example')
]),
emitsDone);
});
You'll probably want the CI to run every twenty-four hours, since broken links aren't created from just your own commits, but external web pages being deleted as well.