link_checker library

Can find links and check if they're dead.

This library can test most types of files, from Markdown to Java.

Links must be specified with the HTTP or HTTPS protocol to be found. For example, https://google.com.

A "bad link" is a link whose status code retrieved upon making a request to it wasn't in the range of 200-299. A list of all the HTTP status codes are here: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection. The only extra status code used in this library is 0, which indicates that a server couldn't be contacted because the website doesn't exist.

Classes

The path to the file having the bad link, the bad link, and its status code.
BadLinkStatus
The link a request was made to, and the status code returned.
BlacklistedDirectory
LinkLocation
The path to the file containing the link, and the link.

Functions

canUseHttps(String link) → Future<bool>
Returns whether link can be served over HTTPS.
convertToHttps(String link) → String
Returns link as an HTTPS link.
getBadLinksInDirectory({String path, bool recursive: true, bool followLinks: true, List<BlacklistedDirectory> blacklistedDirectories, List<String> blacklistedFilePaths, List<String> blacklistedLinks, List<RegExp> blacklistedLinksRegexes }) → Stream<BadLink>
Checks a directory for bad links. [...]
getBadLinksInFile(String path, { List<String> blacklistedLinks, List<RegExp> blacklistedLinksRegexes }) → Stream<BadLinkStatus>
Yields bad links found in the file located at path. [...]
getLinksInDirectory({String path, bool recursive: true, bool followLinks: true, List<BlacklistedDirectory> blacklistedDirectories, List<String> blacklistedFilePaths, List<String> blacklistedLinks, List<RegExp> blacklistedLinksRegexes }) → Stream<LinkLocation>
Yields the links found in a directory. [...]
getLinksInFile(String path, { List<String> blacklistedLinks, List<RegExp> blacklistedLinksRegexes }) → Future<List<String>>
Returns the links found in the file at path. [...]
getLinkStatus(String link) → Future<int>
Returns the status code received after making a request to link. [...]
isGoodStatusCode(int statusCode) → bool
Returns whether or not statusCode is in the range of 200 and 299.
Returns whether link uses HTTPS.
parseUrl(String url) → String
Returns url after stripping unnecessary delimiters. [...]