0.1.0 • Published 2 years ago
md-nat v0.1.0
MD-NAT
It's a library that will allow you to validate links found in markdown files. These results will include the links status, total links, unique links and broken links.
Installation 🔧
npm install md-nat
IMPORTANT md-nat is ESM
User guide 📕
import md-nat from 'md-nat';
You can run the library through the terminal:
md-nat <path-to-file-or-directory> [options]
The path entered can be either relative or absolute and the options are the following:
--validate
--stats
--stats --validate or --validate --stats
--help
📌 md-nat ../Folder/welcome.md
(default option)
$ md-nat ../Folder/welcome.md
[
{
href: 'https://github.com/Natalia7919/LIM016-md-links',
text: "Natalia's github",
file: 'C:\\Users\\User\\Desktop\\LIM016-md-links\\Folder\\welcome.md'
},
{
href: 'https://github.com/Natalia7919/LIM016-md-links',
text: "Natalia's github",
file: 'C:\\Users\\User\\Desktop\\LIM016-md-links\\Folder\\welcome.md'
},
{
href: 'https://github.com/error404omg',
text: 'Github error',
file: 'C:\\Users\\User\\Desktop\\LIM016-md-links\\Folder\\welcome.md'
},
]
📌 md-nat ../Folder/welcome.md --validate
$ md-nat ../Folder/welcome.md --validate
C:\\Users\\User\\Desktop\\LIM016-md-links\\Folder\\welcome.md
https://github.com/Natalia7919/LIM016-md-links => Ok => 200 => Natalia's github
C:\\Users\\User\\Desktop\\LIM016-md-links\\Folder\\welcome.md
https://github.com/Natalia7919/LIM016-md-links => Ok => 200 => Natalia's github
C:\\Users\\User\\Desktop\\LIM016-md-links\\Folder\\welcome.md
https://github.com/error404omg => Fail => 400 => Github error
📌 md-nat ../Folder/welcome.md --stats
$ md-nat ../Folder/welcome.md --stats
Total: 3
Unique: 2
📌 md-nat ../Folder/welcome.md --validate --stats or --stats--validate
$ md-nat ../Folder/welcome.md --validate --stats
Total: 3
Unique: 2
Broken: 1
📌 md-nat ../Folder/welcome.md --val
$ md-nat ../Folder/welcome.md --val
It's not a valid option, please type md-nat --help
📌 md-nat --help
$ md-nat --help
Welcome to --help
How to use md-nat?
md-nat <path-to-file-or-directory> [options]
What are my options?
--validate:
will show you the path, links, status, ok,text
--stats:
will show you the statistics of the links
--stats --validate or --validate --stats:
will show you both validate and stats options
For example: md-nat ../example.md --validate
What happens if I don't type an option?
If you just type: md-nat ../example.md
By default you will be shown an array of objects containing the link, text and path.
Flowcharts 📊
Build with 🛠
- Node.js - To create the library
- NPM - To manage packages
- ES modules- To handle modules
- Node-fetch - To make HTTP calls
- Chalk - To style terminal output
Author 🙎♀️
0.1.0
2 years ago