Gathering detailed insights and metrics for @boillodmanuel/markdown-link-check
Gathering detailed insights and metrics for @boillodmanuel/markdown-link-check
Gathering detailed insights and metrics for @boillodmanuel/markdown-link-check
Gathering detailed insights and metrics for @boillodmanuel/markdown-link-check
checks all of the hyperlinks in a markdown text to determine if they are alive or dead
npm install @boillodmanuel/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
4.7.0
Package Id
@boillodmanuel/markdown-link-check@4.7.0
Unpacked Size
81.32 kB
Size
20.50 kB
File Count
21
NPM Version
6.14.8
Node Version
12.20.0
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
8
ℹ️ Fork of tcort repository (version 3.8.3), with several improvements:
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 @boillodmanuel/markdown-link-check
To install the command line tool globally, run:
1npm install -g @boillodmanuel/markdown-link-check
The command line tool checks markdown links from 1 or several files or URLs or from standard input.
Note: You can either use this library from a javascript/typescript project (as a node dependency) or from command line. To run the command line, type:
markdown-link-check README.md
if you installed it globallynpx markdown-link-check README.md
if you installed it as a project dependency.Usage: markdown-link-check [options] [filenameOrUrls...]
Argument:
[filenameOrUrls...]
: one or several files or URLs. If absent, process stdinOptions:
Options specific to command line:
-c, --config [config]
: apply a config file (JSON), holding e.g. url specific header configuration-q, --quiet
: displays errors only-v, --verbose
: displays detailed error information--print-summary
: print total number of inputs and links process with details about link status (alive, ignored, dead, error)--print-cache-stats
prints cache usage (hits and misses).--print-long-checks
prints links that took more than given delay to verify. Default delay is 5000
, configure it with --long-checks-max-duration
option.--long-checks-max-duration
5000
.-h, --help
display help for commandOptions that override configuration file:
-a, --alive <codes>
comma separated list of HTTP code to be considered as alive--retry-on-error
retry after the an error--retry-on-429
retry after the duration indicated in 'retry-after' header when HTTP code is 429--timeout <duration>
timeout in zeit/ms format. (e.g. 2000ms
, 20s
, 1m
). Default is 10s
.-e, --fileEncoding <encoding>
set file enconding. Default is utf-8
.-d, --debug
displays debug traces (very verbose)Simple examples:
1# Check links from a markdown file hosted on the web 2markdown-link-check https://github.com/tcort/markdown-link-check/blob/master/README.md 3 4# Check links from a local markdown file 5markdown-link-check ./README.md 6 7# Check links from multiples markdown file 8markdown-link-check ./README.md ./CHANGELOG.md 9 10# Check links from stdin 11curl -s https://github.com/tcort/markdown-link-check/blob/master/README.md | markdown-link-check
Advanced examples:
Check links for each files
1# Check links from a local markdown folder (recursive) 2find . -name \*.md -exec markdown-link-check {} \;
Check links for all files (run a single process which can leverage cache)
1# Add files in a bash array (using -print0 to support file names with space or special characters) 2FILES=() 3while IFS= read -r -d $'\0' FILE; do 4 FILES+=("$FILE") 5done < <(find . -name '*.md' ! -path './node_modules/*' -print0) 6markdown-link-check --print-summary "${FILES[@]}"
This part is not documented. The best way to kwow how to use this library from code is to look at run
function in /src/bin/markdown-link-check.ts` which is the entry point of the command line utility.
You can configure the processing with using a configuration file described below.
File config.json
attributes per category:
Input content:
fileEncoding
: set file enconding. Default is utf-8
.Link management:
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.httpHeaders
: The headers are only applied to links where the link starts with one of the supplied URLs in the urls
section.resolveAbsolutePathWithBaseUrl
: if true
links with absolute path (e.g. /section/page1.md
) are resolved from baseUrl
(see below) where as links with with relative path (e.g. ./page2.md
) are resolved from current url/path. This option reflects some wiki behavior. Default is false
.baseUrl
: base url/path used to resolved links with absolute path if resolveAbsolutePathWithBaseUrl
is true. The value should starts with file://
, http://
or https://
.Error management:
timeout
timeout in zeit/ms format. (e.g. "2000ms"
, 20s
, 1m
). Default 10s
.retryOnError
if this is true
then retry after an error.retryOn429
if this is true
then retry request when response is an HTTP code 429 after the duration indicated by the retry-after
response header or by the fallbackRetryDelay
option.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 5s
.aliveStatusCodes
a list of HTTP codes to consider as alive.Concurrency:
concurrentFileCheck
: Number of file or url processed concurrently. Default is 2.concurrentCheck
: Number of links processed concurrently for a single file or url. Default is 2.Debug:
debug
displays debug tracesdebugToStdErr
redirect debug trace to sterr instead of stdoutExample:
1{ 2 "ignorePatterns": [ 3 { 4 "pattern": "^http://example.net" 5 } 6 ], 7 "replacementPatterns": [ 8 { 9 "pattern": "^.attachments", 10 "replacement": "file://some/conventional/folder/.attachments" 11 } 12 ], 13 "httpHeaders": [ 14 { 15 "urls": ["https://example.com"], 16 "headers": { 17 "Authorization": "Basic Zm9vOmJhcg==", 18 "Foo": "Bar" 19 } 20 } 21 ], 22 "timeout": "20s", 23 "retryOn429": true, 24 "retryCount": 5, 25 "fallbackRetryDelay": "30s", 26 "aliveStatusCodes": [200, 206], 27 "concurrentFileCheck": 5, 28 "concurrentCheck": 2, 29 "fileEncoding": "utf-8", 30 "resolveAbsolutePathWithBaseUrl": true, 31 "baseUrl": "/var/wiki", 32 "debug": false, 33 "debugToStdErr": false, 34}
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.Note: The documentation in this section comes from original repository and is not maintained in this fork but kept for information. this library
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
)
Note: Github action is not maintained in this fork.
Please head on to github-action-markdown-link-check.
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:
baseUrl
the base URL for relative links.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. Example: [{ pattern: /^.attachments/, replacement: "file://some/conventional/folder/.attachments" }]
ignoreDisable
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
.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});
1npx markdown-link-check test/file1.md 2npx markdown-link-check --inputs test/file1.md test/file2.md
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