Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdlinks-dors

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdlinks-dors

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

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

flowchart

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

FAQs

Package last updated on 05 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc