meowdown-links is a library tool for extracting and validating markdown links.
Current release requires Node.js
npm install -g meowdown-links
$ meowdown-links ./path/to/file.md
--validate
argument returns an href, md text, pathfile, number of line, response status and redirected from path (if there is one).
--stats
argument returns total and unique links.
--validate --stats
or --stats --validate
arguments return total, unique, broken and redirected links.
Library usage example:
const meowDownLinks = require('meowDownLinks');
meowDownLinks('./text.md')
.then(results => {
// results => [{ href, text, line, file }]
})
.catch(error => {
console.log(error.message);
});
meowDownLinks('./folder/text.md', { validate: true })
.then(results => {
// results => [{ href, text, line, file, status, ok, originalHref }]
})
.catch(error => {
console.log(error.message);
});
meowDownLinks('./folder/dir')
.then(results => {
// results => [{ href, text, file, status, ok, originalHref }]
})
.catch(error => {
console.log(error.message);
});
meowDownLinks(path, options)
-
path:
a string representing a relative or absolute path. -
options:
an object for optional arguments for the api.-
validate:
a boolean for validating links. -
stats:
a boolean for requesting links stats.
-
By default, options will be false. If no arguments are set, the promise'll only return an array with an href, text and path to the extracted links file.
Is important to remember this library will only extract and validate urls to webpages. MD images are not supported.
CLI messages are personalized.
- Working URLs are green.
- Broken URLs are red.
- Originally redirected URLs are cyan.
The message also includes a random ASCII cat art drawing.