npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

giovandyyg-md-links

v1.0.12

Published

"Lee y analiza archivos en formato Markdown, para verificar los links que contengan y reportan algunas estadísticas."

Downloads

31

Readme

Markdown Links 📄🔗

About md-Links

Our options:

  • Validate Links(OK, FAIL)
  • Stats Links(total, unique, broken)

Flow Chart

-Our diagram simplifies us to understand with ease the complexity of the process that we will carry out to build our library.

  • Flow Charts.
  • Git hub projects.

Flow Chart API

diagrama1

Flow Chart CLI

diagrama2

How to install mdLinks?

  • Install this library with this command: npm install giovandyyg-md-links

API mdLinks(path, opts)

Example of how to use it:

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);

CLI (Command Line Interface - Interfaz de Línea de Comando)


Remember that to use this library you need to insert:

👉 md-links <path-to-file> [valid arguments]
*****************Valid Arguments*****************
⭐md-links <path-to-file> --validate   --stats
⭐md-links <path-to-file> --stats      --validate
⭐md-links <path-to-file> -v   -s
⭐md-links <path-to-file> -s   -v
⭐md-links <path-to-file> --validate  -v
⭐md-links <path-to-file> --stats     -s
************************************************* 

Learning goals

  • [⭐] Entender la diferencia entre expression y statements.
  • [⭐] Entender el uso de bucles (for | forEach).
  • [⭐] Manipular arrays (filter | map | sort | reduce).
  • [⭐] Entender la diferencia entre tipos de datos atómicos y estructurados.
  • [⭐] Utilizar linter para seguir buenas prácticas (ESLINT)

Javascript

  • [⭐] Uso de callbacks
  • [⭐] Consumo de Promesas
  • [⭐] Creacion de Promesas
  • [⭐] Modulos de Js
  • [⭐] Recursión

Node

  • [⭐] Sistema de archivos
  • [⭐] package.json
  • [⭐] crear modules
  • [⭐] Instalar y usar modules
  • [⭐] npm scripts
  • [⭐] CLI (Command Line Interface - Interfaz de Línea de Comando)

Testing

  • [⭐] Testeo de tus funciones
  • [⭐] Testeo asíncrono
  • [⭐] Uso de librerias de Mock
  • [⭐] Mocks manuales
  • [⭐] Testeo para multiples Sistemas Operativos

Git y Github

  • [⭐] Uso de comandos de git (add | commit | pull | status | push)
  • [⭐] Manejo de repositorios de GitHub (clone | fork | gh-pages)
  • ⭐ Colaboración en Github (branches | pull requests | |tags)
  • [⭐] Organización en Github (projects | issues | labels | milestones)

Buenas prácticas de desarrollo

  • [⭐] Modularización
  • [⭐] Nomenclatura / Semántica

Pistas / Tips

Instalacion desde GitHub

Para que el módulo sea instalable desde GitHub solo tiene que:

  • Estar en un repo público de GitHub
  • Contener un package.json válido

Con el comando npm install githubname/reponame podemos instalar directamente desde GitHub. Ver docs oficiales de npm install acá.

Por ejemplo, el course-parser que usamos para la currícula no está publicado en el registro público de NPM, así que lo instalamos directamente desde GitHub con el comando npm install Laboratoria/course-parser.

Implementación

La implementación de este proyecto tiene varias partes: leer del sistema de archivos, recibir argumentos a través de la línea de comando, analizar texto, hacer consultas HTTP, ... y todas estas cosas pueden enfocarse de muchas formas, tanto usando librerías como implementando en Vanilla JS.

Por poner un ejemplo, el parseado (análisis) del markdown para extraer los links podría plantearse de las siguientes maneras (todas válidas):

  • Usando un módulo como markdown-it, que nos devuelve un arreglo de tokens que podemos recorrer para identificar los links.
  • Siguiendo otro camino completamente, podríamos usar expresiones regulares (RegExp).
  • También podríamos usar una combinación de varios módulos (podría ser válido transformar el markdown a HTML usando algo como marked y de ahí extraer los link con una librería de DOM como JSDOM o Cheerio entre otras).
  • Usando un custom renderer de marked (new marked.Renderer()).

Recursos necesarios