markdown-link-check
Advanced tools
+10
-0
| # Changes | ||
| ## Version 3.8.4 | ||
| * #106 / #114 / #126 better 429 handling | ||
| * #129 / #135 add timeout option | ||
| * #122 fix typo | ||
| * #139 add other tools and linters | ||
| * #121 / #132 github actions | ||
| * #110 / #127 / #113 / #133 / #140 docker images | ||
| * update dependencies | ||
| ## Version 3.8.3 | ||
@@ -4,0 +14,0 @@ |
+1
-0
@@ -75,2 +75,3 @@ 'use strict'; | ||
| linkCheck(link, opts, function (err, result) { | ||
| if (opts.showProgressBar) { | ||
@@ -77,0 +78,0 @@ bar.tick(); |
+7
-7
| { | ||
| "name": "markdown-link-check", | ||
| "version": "3.8.3", | ||
| "version": "3.8.4", | ||
| "description": "checks the all of the hyperlinks in a markdown text to determine if they are alive or dead", | ||
@@ -38,12 +38,12 @@ "bin": { | ||
| "chalk": "^4.1.0", | ||
| "commander": "^6.1.0", | ||
| "link-check": "^4.5.1", | ||
| "commander": "^6.2.0", | ||
| "link-check": "^4.5.3", | ||
| "lodash": "^4.17.20", | ||
| "markdown-link-extractor": "^1.2.6", | ||
| "request": "^2.88.2", | ||
| "lodash": "^4.17.20", | ||
| "progress": "^2.0.3" | ||
| "progress": "^2.0.3", | ||
| "request": "^2.88.2" | ||
| }, | ||
| "devDependencies": { | ||
| "expect.js": "^0.3.1", | ||
| "mocha": "^8.1.3", | ||
| "mocha": "^8.2.1", | ||
| "jshint": "^2.12.0", | ||
@@ -50,0 +50,0 @@ "express": "^4.17.1" |
+76
-48
@@ -0,1 +1,3 @@ | ||
|  | ||
| # markdown-link-check | ||
@@ -11,7 +13,11 @@ | ||
| npm install --save-dev markdown-link-check | ||
| ```shell | ||
| npm install --save-dev markdown-link-check | ||
| ``` | ||
| To install the command line tool globally, run: | ||
| npm install -g markdown-link-check | ||
| ```shell | ||
| npm install -g markdown-link-check | ||
| ``` | ||
@@ -22,9 +28,11 @@ --- | ||
| Build a Docker image: | ||
| Docker images are built with each release. Use the `stable` tag for the current stable release. | ||
| docker build --tag markdown-link-check . | ||
| Add current directory with your `README.md` file as read only volume to `docker run`: | ||
| Pipe your `README.md` file to `docker run`: | ||
| ```shell | ||
| docker run -v ${PWD}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /tmp/README.md | ||
| ``` | ||
| docker run --rm -i markdown-link-check < 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`) | ||
@@ -35,2 +43,6 @@ ## Run in a GitHub action | ||
| ## Run in other tools | ||
| - [Mega-Linter](https://nvuillam.github.io/mega-linter/): Linters aggregator [including markdown-link-check](https://nvuillam.github.io/mega-linter/descriptors/markdown_markdown_link_check/) | ||
| ## API | ||
@@ -50,2 +62,3 @@ | ||
| * `showProgressBar` enable an ASCII progress bar. | ||
| * `timeout` timeout in [zeit/ms](https://www.npmjs.com/package/ms) format. (e.g. `"2000ms"`, `20s`, `1m`). Default `10s`. | ||
| * `httpHeaders` to apply URL specific headers, see example below. | ||
@@ -55,2 +68,7 @@ * `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/ }]` | ||
| * `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](https://www.npmjs.com/package/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)`. | ||
@@ -120,30 +138,31 @@ * `err` an Error object when the operation cannot be completed, otherwise `null`. | ||
| markdown-link-check https://github.com/tcort/markdown-link-check/blob/master/README.md | ||
| ```shell | ||
| markdown-link-check https://github.com/tcort/markdown-link-check/blob/master/README.md | ||
| ``` | ||
| #### Check links from a local markdown file | ||
| markdown-link-check ./README.md | ||
| ```shell | ||
| markdown-link-check ./README.md | ||
| ``` | ||
| #### Check links from a local markdown folder (recursive) | ||
| find . -name \*.md -exec markdown-link-check {} \; | ||
| ```shell | ||
| find . -name \*.md -exec markdown-link-check {} \; | ||
| ``` | ||
| #### Check links from standard input | ||
| cat *.md | markdown-link-check | ||
| #### Usage | ||
| ``` | ||
| ```shell | ||
| Usage: markdown-link-check [options] [filenameOrUrl] | ||
| Usage: markdown-link-check [options] [filenameOrUrl] | ||
| Options: | ||
| -p, --progress show progress bar | ||
| -c, --config [config] apply a configuration file (JSON) | ||
| -q, --quiet display errors only | ||
| -v, --verbose displays detailed error information | ||
| -h, --help output usage information | ||
| Options: | ||
| -p, --progress show progress bar | ||
| -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 | ||
| -a, --alive <code> comma separated list of HTTP code to be considered as alive | ||
| -r, --retry retry after the duration indicated in 'retry-after' header when HTTP code is 429 | ||
| -h, --help display help for command | ||
| ``` | ||
@@ -158,2 +177,7 @@ | ||
| * `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](https://www.npmjs.com/package/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](https://www.npmjs.com/package/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. | ||
@@ -164,31 +188,35 @@ **Example:** | ||
| { | ||
| "ignorePatterns": [ | ||
| { | ||
| "pattern": "^http://example.net" | ||
| } | ||
| ], | ||
| "replacementPatterns": [ | ||
| { | ||
| "pattern": "^.attachments", | ||
| "replacement": "file://some/conventional/folder/.attachments" | ||
| } | ||
| ], | ||
| "httpHeaders": [ | ||
| { | ||
| "urls": [ | ||
| "https://example.com" | ||
| ], | ||
| "headers": { | ||
| "Authorization": "Basic Zm9vOmJhcg==", | ||
| "Foo": "Bar" | ||
| } | ||
| } | ||
| ] | ||
| "ignorePatterns": [ | ||
| { | ||
| "pattern": "^http://example.net" | ||
| } | ||
| ], | ||
| "replacementPatterns": [ | ||
| { | ||
| "pattern": "^.attachments", | ||
| "replacement": "file://some/conventional/folder/.attachments" | ||
| } | ||
| ], | ||
| "httpHeaders": [ | ||
| { | ||
| "urls": ["https://example.com"], | ||
| "headers": { | ||
| "Authorization": "Basic Zm9vOmJhcg==", | ||
| "Foo": "Bar" | ||
| } | ||
| } | ||
| ], | ||
| "timeout": "20s", | ||
| "retryOn429": true, | ||
| "retryCount": 5, | ||
| "fallbackRetryDelay": "30s", | ||
| "aliveStatusCodes": [200, 206] | ||
| } | ||
| ``` | ||
| ## Testing | ||
| npm test | ||
| ```shell | ||
| npm test | ||
| ``` | ||
@@ -195,0 +223,0 @@ ## License |
Sorry, the diff of this file is not supported yet
22543
17.07%218
14.74%Updated
Updated