mirror of
https://github.com/LukasDzenk/markdownUrlChecker.git
synced 2026-05-28 13:57:39 +00:00
No description
- TypeScript 100%
| dist | ||
| helper | ||
| input | ||
| output | ||
| tests | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc.json | ||
| index.ts | ||
| interfaces.ts | ||
| jest.config.ts | ||
| jsconfig.json | ||
| package.json | ||
| readme.md | ||
| tsconfig.json | ||
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:
- Finding internal markdown links via regex (e.g.
[Some title](#Title--sub-title--sub-sub-title)) - 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.
- 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.