Creates a validator, filling any option left unset with its default: external links unchecked, a 5000 ms external timeout, missing internal files treated as errors, Claude imports checked, freshness and authentication detection off, authentication-required links allowed, wikilinks unchecked, no skipped domains and 2 retries for transient external failures. The freshness and authentication detectors are created only when their option is enabled.
Validation options.
Checks for circular references. With parsed files, follows each file's dependencies and returns every cycle found as a path of files. With plain path strings there is no dependency information to follow, so the result always reports no circular references.
Parsed markdown files or file paths to check.
The cycles for parsed files, or a summary object for paths.
Checks for circular references. With parsed files, follows each file's dependencies and returns every cycle found as a path of files. With plain path strings there is no dependency information to follow, so the result always reports no circular references.
Parsed markdown files or file paths to check.
The cycles for parsed files, or a summary object for paths.
Validates every link in one file.
Parsed markdown file to check.
The broken links found, empty when every link is valid or skipped by the options.
Validates every link in each of the given files.
Parsed markdown files to check.
A result that is valid only when no broken links were found, with the number of files and links checked.
Validates one link according to its type and the validator's options. Link types whose checking is disabled, and reference links, are treated as valid. An unexpected failure while checking is reported as an invalid-format broken link rather than thrown.
Link to check.
Path of the file containing the link.
A broken link description, or null when the link is valid or not checked.
Combines link validation with circular reference detection across a set of files.
Parsed markdown files to check.
A result whose valid flag is true only when there are no broken links and no cycles, plus the cycles, the broken links and any warnings.
Validates a specific array of links from a single file.
Array of links to validate
Path to the source file containing the links
Promise resolving to validation result with broken links
Validates markdown links and identifies broken or problematic references.
The LinkValidator checks various types of links including internal file references, external URLs, and Claude import syntax. It provides comprehensive reporting of validation issues and supports different validation modes for different use cases.
Example
Basic link validation
Example
Batch validation