Markdown is a lightweight markup language that is very popular among developers. It is used on many platforms that handle plain text (GitHub, forums, blogs, etc.) and it is very common to find several files in this format in any type of repository (starting with the traditional README.md).
These Markdown files typically contain links that are often broken or no longer valid, greatly diminishing the value of the information being shared.
Within an open-source community, we have proposed to create a tool using Node.js, which reads and analyzes files in Markdown format to check the links they contain and report some statistics.
Mdlinks is a library developed using Node.js that allows you to read and analyze the links within a Markdown file and returns general information about them, thus reducing the time it would take to verify them manually.
CLI flow chart:
API (mdlinks) flow chart:
After downloading the package, you will need to enter index.js followed by the path of the file desired to be analysed and the option(s).
With index.js ./markdown/file/path --validate you will get the text, type(internal or external), location(URL), valid(can be true or false) and the HTTP response for each link within the file.
With index.js ./markdown/file/path --stats you will get the total number of links and the total number of unique links.
Also you can input index.js ./markdown/file/path --stats --validate (or viceversa) to get the total number of links, the total number of unique links and the total number of broken links.





