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

mdlinks-dors

v1.1.2

Published

Node library to validate and stats ok and broken URLs in a markdown file

Downloads

8

Readme

Project: Markdown Links

mdlinks-dors is a nodejs library to get, validate, and get the stats of the URL links in a markdown file. It was developed in JavaScript and uses four dependencies: node-fetch, yargs, chalk, and jest.

Install

To install write the following command line:

npm i mdlinks-dors 

Usage - Command Line Interface, CLI

To execute the library write the shorcut mdlinks, the option command and the path after the --file flag as follows:

mdlinks [command] --file <path> 

Options of path

  • Single file path
  • Directory path unfolds a menu with all .md files in it.
$ mdLinks validateStats --file /home/laboratoria159-pm/CDMX009-MdLinks/
Option: ValidateStats
0: /home/laboratoria159-pm/CDMX009-MdLinks/README.md
1: /home/laboratoria159-pm/CDMX009-MdLinks/file.md
2: /home/laboratoria159-pm/CDMX009-MdLinks/file1.md
3: /home/laboratoria159-pm/CDMX009-MdLinks/nofile.md
Select the number of the file path you want:

Options commands

  • validate command validates URL links status as follow:
    • status code 200: ok
    • status code 404: broken
mdlinks validate --file <path>

Results are unfold as an array of objects with URL information:

[
  {
    href: 'https://dzone.com/articles/how-single-page-web-applications-actually-workkk',
    text: 'SPA (algo) otro algo',
    File: '/home/laboratoria159-pm/CDMX009-MdLinks/file1.md',
    code: 404,
    status: 'broken'
  },
  {
    href: 'https://darwindigital.com/mobile-first-versus-responsive-web-design/',
    text: 'mobile first',
    File: '/home/laboratoria159-pm/CDMX009-MdLinks/file1.md',
    code: 200,
    status: 'ok'
  },
  {
    href: 'http://darwindigital.com/mobile-first-versus-responsive-web-design/',
    text: 'mobile',
    File: '/home/laboratoria159-pm/CDMX009-MdLinks/file1.md',
    code: 200,
    status: 'ok'
  }
]
  • stats command get the stats of ok and broken URL links.
mdlinks stats --file <path>

Results unfold as follows:

Url Ok: 2
Url broken: 1
  • validateStats commadn does both, validate and get tha stats of URL links.
mdlinks validateStats --file <path>

Results unfold as a combination of both validate and stats commands.

[
  {
    href: 'https://dzone.com/articles/how-single-page-web-applications-actually-workkk',
    text: 'SPA (algo) otro algo',
    File: '/home/laboratoria159-pm/CDMX009-MdLinks/file1.md',
    code: 404,
    status: 'broken'
  },
  {
    href: 'https://darwindigital.com/mobile-first-versus-responsive-web-design/',
    text: 'mobile first',
    File: '/home/laboratoria159-pm/CDMX009-MdLinks/file1.md',
    code: 200,
    status: 'ok'
  },
  {
    href: 'http://darwindigital.com/mobile-first-versus-responsive-web-design/',
    text: 'mobile',
    File: '/home/laboratoria159-pm/CDMX009-MdLinks/file1.md',
    code: 200,
    status: 'ok'
  }
]
Url Ok: 2
Url broken: 1

Logical flowchart


Objetivos de aprendizaje

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

Javascript

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

Node

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

Testing

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

Git y Github

  • [x] Organización en Github

Buenas prácticas de desarrollo

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