This lib was created throughout one of Alura's courses of NodeJS.
It is very simple and made for study purposes, but feel free to try it out!
See it also on npm!
It reads a markdown file and searches for hyperlinks in it, using regular expressions (regex) to do the trick.
For instance, if you have in your markdown file a hyperlink pointing to https://german-gender-api.deta.dev, it will show you the following response in your terminal:
npm run cli ./arquivos/texto1.md
Lista de links:
[ { 'German Gender API': 'https://german-gender-api.deta.dev/' } ]
It includes a title, "Lista de links" (List of links) and an array of each hyperlink and its title inside the markdown file.
It's simple: simply type 'npm run cli' in your terminal, and pass the following arguments:
- File path, e.g.,
./arquivos/texto1.md
- validar (optional)
As to the second argument, if you want to, you can also validate each link of the read file by adding it.
If you do so, it'll show you the hyperlinks in the file, as well as the status code of requests made on them.
npm run cli ./arquivos/texto1.md
Links validados:
[
{
'German Gender API': 'https://german-gender-api.deta.dev/',
status: '200 - OK'
}
]
- node-fetch (to make the requests)
- chalk (to color the terminal output)
├── cli.js
├── examples
│ ├── index.js
│ └── percorrendo-diretorios.js
├── http-validacao.js
├── index.js
├── package.json
├── package-lock.json
├── README.md
└── test
└── index.test.js
It contains some tests related to my studies of JavaScript and NodeJS. Since this is not a serious library, I'll keep them there ^~^.