# md-links-nathaly-creat

> * [1. Preámbulo](#1-preámbulo) * [2. Resumen del proyecto](#2-resumen-del-proyecto) * [3. Objetivos de aprendizaje](#3-objetivos-de-aprendizaje) * [4. Consideraciones generales](#4-consideraciones-generales) * [5. Criterios de aceptación mínimos del p

Latest version **0.1.0** (published 2022-05-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install md-links-nathaly-creat
pnpm add md-links-nathaly-creat
yarn add md-links-nathaly-creat
bun add md-links-nathaly-creat
```

Provides the command `md-links`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-05-09 |
| First published | 2022-05-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.x |
| Dependencies | 5 |
| Unpacked size | 42.3 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nathaly Huerta |
| Maintainers | nathaly-creat |
| Keywords | cli, api, recursive, npm |

## Links

- npm: https://www.npmjs.com/package/md-links-nathaly-creat
- Repository: https://github.com/nathaly-creat/BOG004-md-links
- Homepage: https://github.com/nathaly-creat/BOG004-md-links#readme
- Issues: https://github.com/nathaly-creat/BOG004-md-links/issues
- npm.io page: https://npm.io/package/md-links-nathaly-creat

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^0.27.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [figlet](https://npm.io/package/figlet.md) ^1.5.2
- [readdirp](https://npm.io/package/readdirp.md) ^3.6.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2022-05-09

## README

# Md-Links. 


Librería que permite extraer y validar links en archivos markdown (.md), obteniendo estadísticas de links totales, únicos y rotos.



# Diagrama de Flujo
[Diagrama de Flujo](https://www.figma.com/file/3wXsiTaU1mi2sTTKcMw5V2/Untitled?node-id=0%3A1)

# 1- CLI


*COLOCAR EXTENSION NPM*

# 1.2 Guía de Funcionalidad.



Recibe como argumento una path/ruta de un archivo'.md' o un directorio que contenga archivo '.md'. Adicional en la terminal se recive opciones a ejecutar. 

La Librerría cuenta con un comando de ayuda identificado en la opción como --h o --help en idioma español.

En la terminal se ejecuta de la siguiente manera: 

     `$ md-links [path] [options]`

Nota: no es obligatorio usar [] es identificador de posición.


╭─────────────────────
│    Tus opciones son las siguientes:
╰─────────────────────


 **Sin [options]:**
 ----
- Se muestra un reporte de todos los enlaces de un archivo markdown.

Con `validate:false` :

    - `href`: URL encontrada.
    - `text`: Texto que aparecía dentro del link (`<a>`).
    - `file`: Ruta del archivo donde se encontró el link.

    Reporte:
    [{ href, text, file, }]

![validateFalse](https://res.cloudinary.com/dtaq1ip2g/image/upload/v1652117108/validate_false_ryby7p.png)

**Con [options]:**
----
- --validate o --v:

       - Validará cada link dentro del archivo.
       - Retornará un reporte con los links validados. 
       - El reporte arrojara: Mensaje (str) de OK o FAIL, estado del link (HTTP).

       Reporte se corresponde a:
       [{ href, text, file, status, str, }]

    ![trueAndStats](https://res.cloudinary.com/dtaq1ip2g/image/upload/v1652117441/validate_true_--v_hne3ha.png)


```js
const mdLinks = require("md-links");

mdLinks("./some/example.md")
  .then(links => {
    // => [{ href, text, file }, ...]
  })
  .catch(console.error);

mdLinks("./some/example.md", { validate: true })
  .then(links => {
    // => [{ href, text, file, status, ok }, ...]
  })
  .catch(console.error);

mdLinks("./some/dir")
  .then(links => {
    // => [{ href, text, file }, ...]
  })
  .catch(console.error);
```




### *Estadísticas del archivo markdown:*

-  --stats o --s :

       - Obtendrá el total de links dentro del archivo.
       - Genera un reporte de la cantidad de links únicos y totales dentro del archivo markdown.

       Reporte:

       Total: #
       Unique: #


![Stats](https://res.cloudinary.com/dtaq1ip2g/image/upload/v1652117108/stadisticas_validate_false_e9kkx4.png)


↪️  --validate --stats o --v --s:
       - Validará cada link dentro del archivo.
       - Podras tener toda la informacion sobre las estadísticas --stats y los links rotos dentro del archivo. 
        Reporte:

       Total: #
       Unique: #
       Broquen: #

![broquen](https://res.cloudinary.com/dtaq1ip2g/image/upload/v1652117108/validate_mas_stats_c1tudi.png)


# Ayuda de CLI

Puede ingresar el siguiente comando en la terminal.

Ejemplo:
md-Links means --h

![Ayuda](https://res.cloudinary.com/dtaq1ip2g/image/upload/v1652117860/ayuda_yakqvm.png)

# Desarrollado por Nathaly Huerta.

---
_Source: https://npm.io/package/md-links-nathaly-creat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
