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

keupa-mdlinks

v1.0.2

Published

fetch and validate links from a markdown file

Downloads

5

Readme

mdlinks-title keupa-mdlinks is a library for node.js that allows the user to extract links from a markdown file (.md) and verify the status ( 200 or 404 ).

Install

$ npm i keupa-mdlinks

CLI Usage

$ keupa-mdlinks --file <path-to-file>

Options

--validate // --v

The module makes an http request, validates the link, and returns the HTTP status. Example:

$ keupa-mdlinks --validate --file <path-to-file>
Validated links from your ./test/links.md file: 
   ⋆ href: https://www.google.com/idhucda status: 404 FAILED✕
   ⋆ href: http://superbad.com/1/turkey/viv.html status: 200 OK✓
   ⋆ href: http://lewisatkins.com/projects status: 200 OK✓
--stats // --s

The module returns the links basic stats. Example:

$ keupa-mdlinks --stats --file <path-to-file>
Your file ./test/links.md contains: 
   ⋆ Total: 3
   ⋆ Unique: 3
--stats --validate // --s --v

The module makes an HTTP requests and returns validated stats. Example:

$ keupa-mdlinks --stats --validate --file <path-to-file>
Your file ./test/links.md contains: 
   ⋆ Total: 3
   ⋆ Unique: 3

Objetivos de aprendizaje

Recuerda colocar en esta seccion los objetivos de aprendizaje que quedaron pendientes de tu proyecto anterior.

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

  • [ ] Organización en Github

Buenas prácticas de desarrollo

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

Pistas / Tips

FAQs

¿Cómo hago para que mi módulo sea instalable 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.

Sugerencias de 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 VanillaJS.

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()).

No dudes en consultar a tus compañeras, coaches y/o el foro de la comunidad si tienes dudas existenciales con respecto a estas decisiones. No existe una "única" manera correcta :wink:

Tutoriales / NodeSchool workshoppers

Otros recursos