UNPKG

markdown-url-checker

Version:

The lib takes care of checking every link inside a markdown file to see if they're all up.

18 lines (14 loc) 509 B
#!/usr/bin/env node const chalk = require('chalk'); const pegaArquivo = require('./index'); const validaURLs = require('./http-validacao') const caminho = process.argv; async function processaTexto(caminhoDeArquivo) { const resultado = await pegaArquivo(caminhoDeArquivo[2]); if(caminho[3] === 'validar') { console.log(chalk.yellow('links validados'), await validaURLs(resultado)); } else { console.log(chalk.yellow('lista de links'), resultado); } } processaTexto(caminho)