No description
  • TypeScript 100%
Find a file
2022-10-13 16:19:37 +03:00
dist Bugfix / add export feature 2022-10-13 16:19:37 +03:00
helper Bugfix / add export feature 2022-10-13 16:19:37 +03:00
input Bugfix / add export feature 2022-10-13 16:19:37 +03:00
output Bugfix / add export feature 2022-10-13 16:19:37 +03:00
tests Bugfix / add export feature 2022-10-13 16:19:37 +03:00
.gitignore Bugfix / add export feature 2022-10-13 16:19:37 +03:00
.prettierignore WIP all possible links array building 2022-10-01 23:24:11 +03:00
.prettierrc.json WIP all possible links array building 2022-10-01 23:24:11 +03:00
index.ts Bugfix / add export feature 2022-10-13 16:19:37 +03:00
interfaces.ts WIP all possible links array building 2022-10-01 23:24:11 +03:00
jest.config.ts Working 'npm run serve' and 'npm run test' 2022-10-02 16:03:26 +03:00
jsconfig.json initial 2022-09-29 18:44:35 +03:00
package.json Bugfix / add export feature 2022-10-13 16:19:37 +03:00
readme.md Bugfix / add export feature 2022-10-13 16:19:37 +03:00
tsconfig.json - 2022-10-02 03:29:14 +03:00

Introduction

This Node JS script parses .md files within "input" directory and prints out an array of broken URLs that were found.

Prerequisites

Installation

npm install

Production mode

To log incorrect errors to the console:

npm run check

To log incorrect errors to the console and create .json files with errors in the 'output' directory.

npm run checkAndExport

General concept

The URL checker works by:

  1. Finding internal markdown links via regex (e.g. [Some title](#Title--sub-title--sub-sub-title))
  2. Then, parsing the whole .md document and recursively building a headerObject, which is then used to create an array of all possible valid internal links.
  3. Comparing the two arrays. If there's an item in the array from point 3. that is not found within point 2., then an alert is raised.