Gathering detailed insights and metrics for markdown-link-check
Gathering detailed insights and metrics for markdown-link-check
Gathering detailed insights and metrics for markdown-link-check
Gathering detailed insights and metrics for markdown-link-check
autoantwort-markdown-link-check
checks the all of the hyperlinks in a markdown text to determine if they are alive or dead
@boillodmanuel/markdown-link-check
checks the all of the hyperlinks in a markdown text to determine if they are alive or dead
markdown-links-check
This lib extract the links in a markdown file, has two options: an array result with all links in the file with the title and the URL or test all the URLs and return the status code for each one.
markdown_link_checker_sc
Markdown Link Checker
checks all of the hyperlinks in a markdown text to determine if they are alive or dead
npm install markdown-link-check
Typescript
Module System
Node Version
NPM Version
JavaScript (98.01%)
Dockerfile (1.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
639 Stars
559 Commits
127 Forks
9 Watchers
5 Branches
52 Contributors
Updated on Jul 14, 2025
Latest Version
3.13.7
Package Id
markdown-link-check@3.13.7
Unpacked Size
31.66 kB
Size
9.57 kB
File Count
5
NPM Version
10.8.2
Node Version
18.20.7
Published on
Mar 11, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Extracts links from markdown texts and checks whether each link is
alive (200 OK
) or dead. mailto:
links are validated with
isemail.
To add the module to your project, run:
1npm install --save-dev markdown-link-check
To install the command line tool globally, run:
1npm install -g markdown-link-check
Docker images are built with each release. Use the stable
tag for the current stable release.
Add current directory with your README.md
file as read only volume to docker run
:
1docker run -v ${PWD}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/README.md
Alternatively, if you wish to target a specific release, images are tagged with semantic versions (i.e. 3
, 3.8
, 3.8.3
)
Please head on to github-action-markdown-link-check.
To run as a pre-commit hook:
- repo: https://github.com/tcort/markdown-link-check
rev: ...
hooks:
- id: markdown-link-check
args: [-q]
1linkchecker: 2 stage: test 3 image: 4 name: ghcr.io/tcort/markdown-link-check:3.11.2 5 entrypoint: ["/bin/sh", "-c"] 6 script: 7 - markdown-link-check ./docs 8 rules: 9 - changes: 10 - "**/*.md"
Given a string containing markdown
formatted text and a callback
,
extract all of the links and check if they're alive or dead. Call the
callback
with (err, results)
Parameters:
markdown
string containing markdown formatted text.opts
optional options object containing any of the following optional fields:
showProgressBar
enable an ASCII progress bar.timeout
timeout in zeit/ms format. (e.g. "2000ms"
, 20s
, 1m
). Default 10s
.httpHeaders
to apply URL specific headers, see example below.ignorePatterns
an array of objects holding regular expressions which a link is checked against and skipped for checking in case of a match. Example: [{ pattern: /foo/ }]
replacementPatterns
an array of objects holding regular expressions which are replaced in a link with their corresponding replacement string. This behavior allows (for example) to adapt to certain platform conventions hosting the Markdown. The special replacement {{BASEURL}}
can be used to dynamically link to the base folder (used from projectBaseUrl
) (for example that /
points to the root of your local repository). Example: [{ pattern: /^.attachments/, replacement: "file://some/conventional/folder/.attachments" }, { pattern: ^/, replacement: "{{BASEURL}}/"}]
. You can add "global": true
to use a global regular expression to replace all instances.projectBaseUrl
the URL to use for {{BASEURL}}
replacementignoreDisable
if this is true
then disable comments are ignored.retryOn429
if this is true
then retry request when response is an HTTP code 429 after the duration indicated by retry-after
header.retryCount
the number of retries to be made on a 429 response. Default 2
.fallbackRetryDelay
the delay in zeit/ms format. (e.g. "2000ms"
, 20s
, 1m
) for retries on a 429 response when no retry-after
header is returned or when it has an invalid value. Default is 60s
.aliveStatusCodes
a list of HTTP codes to consider as alive.
Example: [200,206]
callback
function which accepts (err, results)
.
err
an Error object when the operation cannot be completed, otherwise null
.results
an array of objects with the following properties:
link
the link
provided as inputstatus
a string set to either alive
, ignored
or dead
.statusCode
the HTTP status code. Set to 0
if no HTTP status code was returned (e.g. when the server is down).err
any connection error that occurred, otherwise null
.You can write html comments to disable markdown-link-check for parts of the text.
<!-- markdown-link-check-disable -->
disables markdown link check.
<!-- markdown-link-check-enable -->
reenables markdown link check.
<!-- markdown-link-check-disable-next-line -->
disables markdown link check for the next line.
<!-- markdown-link-check-disable-line -->
disables markdown link check for this line.
Basic usage:
1'use strict'; 2 3var markdownLinkCheck = require('markdown-link-check'); 4 5markdownLinkCheck('[example](http://example.com)', function (err, results) { 6 if (err) { 7 console.error('Error', err); 8 return; 9 } 10 results.forEach(function (result) { 11 console.log('%s is %s', result.link, result.status); 12 }); 13});
With options, for example using URL specific headers:
1'use strict'; 2 3var markdownLinkCheck = require('markdown-link-check'); 4 5markdownLinkCheck('[example](http://example.com)', { httpHeaders: [{ urls: ['http://example.com'], headers: { 'Authorization': 'Basic Zm9vOmJhcg==' }}] }, function (err, results) { 6 if (err) { 7 console.error('Error', err); 8 return; 9 } 10 results.forEach(function (result) { 11 console.log('%s is %s', result.link, result.status); 12 }); 13});
The command line tool optionally takes 1 argument, the file name or http/https URL. If not supplied, the tool reads from standard input.
1markdown-link-check https://github.com/tcort/markdown-link-check/blob/master/README.md
1markdown-link-check ./README.md
This checks all files in folder ./docs
with file extension *.md
:
1markdown-link-check ./docs
The files can also be searched for and filtered manually:
1find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check
1Usage: markdown-link-check [options] [filenameOrDirectorynameOrUrl] 2 3Options: 4 -p, --progress show progress bar 5 -c, --config [config] apply a config file (JSON), holding e.g. url specific header configuration 6 -q, --quiet displays errors only 7 -v, --verbose displays detailed error information 8 -a, --alive <code> comma separated list of HTTP code to be considered as alive 9 -r, --retry retry after the duration indicated in 'retry-after' header when HTTP code is 429 10 -h, --help display help for command 11 -V, --version display version string (e.g. `1.2.3`) 12 , --projectBaseUrl <url> the URL to use for {{BASEURL}} replacement
config.json
:
ignorePatterns
: An array of objects holding regular expressions which a link is checked against and skipped for checking in case of a match.replacementPatterns
: An array of objects holding regular expressions which are replaced in a link with their corresponding replacement string. This behavior allows (for example) to adapt to certain platform conventions hosting the Markdown. The special replacement {{BASEURL}}
can be used to dynamically link to the current working directory (for example that /
points to the root of your current working directory). This parameter supports named regex groups the same way as string.replace
method in node.httpHeaders
: The headers are only applied to links where the link starts with one of the supplied URLs in the urls
section.timeout
timeout in zeit/ms format. (e.g. "2000ms"
, 20s
, 1m
). Default 10s
.retryOn429
if this is true
then retry request when response is an HTTP code 429 after the duration indicated by retry-after
header.retryCount
the number of retries to be made on a 429 response. Default 2
.fallbackRetryDelay
the delay in zeit/ms format. (e.g. "2000ms"
, 20s
, 1m
) for retries on a 429 response when no retry-after
header is returned or when it has an invalid value. Default is 60s
.aliveStatusCodes
a list of HTTP codes to consider as alive.projectBaseUrl
the URL to use for {{BASEURL}}
replacementExample:
1{ 2 "projectBaseUrl":"${workspaceFolder}", 3 "ignorePatterns": [ 4 { 5 "pattern": "^http://example.net" 6 } 7 ], 8 "replacementPatterns": [ 9 { 10 "pattern": "^.attachments", 11 "replacement": "file://some/conventional/folder/.attachments" 12 }, 13 { 14 "pattern": "^/", 15 "replacement": "{{BASEURL}}/" 16 }, 17 { 18 "pattern": "%20", 19 "replacement": "-", 20 "global": true 21 }, 22 { 23 "pattern": "images/(?<filename>.*)", 24 "replacement": "assets/$<filename>" 25 } 26 ], 27 "httpHeaders": [ 28 { 29 "urls": ["https://example.com"], 30 "headers": { 31 "Authorization": "Basic Zm9vOmJhcg==", 32 "Foo": "Bar" 33 } 34 } 35 ], 36 "timeout": "20s", 37 "retryOn429": true, 38 "retryCount": 5, 39 "fallbackRetryDelay": "30s", 40 "aliveStatusCodes": [200, 206] 41}
1npm test
See LICENSE.md
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More