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

md-links-extractor

v0.0.3

Published

Esta libreria te permite encontrar los enlaces que hay en un archivo md

Downloads

7

Readme

Markdown link extractor

Versión 0.0.2

Markdown link extractor te permite ver los enlaces que hay en un archivo md.

Caracteristicas

  • Extrae enlaces de un archivo md
  • Información del enlace: link, linea, texto, estado
  • Opción de validar los enlaces individuales y en carpetas
  • Opción de estadísticas de enlaces en los archivos y carpetas
  • Recorre carpetas recursivamente
  • Se puede importar como modulo
  • Se puede usar por medio de la terminal

Porque Markdown link extractor?

Aveces tenemos uno o múltiples archivos md que contienen enlaces y puede ser tedioso revisarlos uno a uno para ver su estado o para obtener estadísticas, Markdown Link Extractor te permite indicando la ruta de un archivo o carpeta obtener esta información.

Instalación

Para instalar globalmente y usar desde la terminal
 npm install -g md-links-extractor

o

npm install -g https://github.com/Estephanyc/scl-2018-01-FE-markdown/
Para instalar como dependencia
npm i md-links-extractor --save

Uso

Linea de comandos

La ruta ingresada puede ser absoluta o relativa y puede ser un archivo o un directorio

$ md-links ./some/example.md

./some/example.md:10 http://algo.com/2/3/ Link a algo
./some/example.md:15 https://otra-cosa.net/algun-doc.html algún doc
./some/example.md:40 http://google.com/ Google

$ md-links ./some/example.md --validate

./some/example.md:10 http://algo.com/2/3/ ok 200 Link a algo
./some/example.md:15 https://otra-cosa.net/algun-doc.html fail 404 algún doc
./some/example.md:40 http://google.com/ ok 301 Google

$ md-links ./some/example.md --stats

total: 3 ok : 2 fails: 1

Importar el modulo

mdLinks(path, options)
Argumentos
  • path: Ruta absoluta o relativa al archivo.

  • options: Un objeto con las siguientes propiedades:

    • validate: Valor que determina si se desea validar los links encontrados en el archivo. (tipo de dato booleano)
    • stats: Valor que determina si se desea obtener estadisticas de los enlaces del archivo. (tipo de dato booleano)
Valor de retorno

Una promesa con un arreglo de objetos, cada objeto representa un link y contiene las siguientes propiedades:

  • href: URL encontrada.
  • text: Texto que aparecía dentro del link.
  • file: Ruta del archivo donde se encontró el link.
  • line: Linea donde se encontró el link.
Ejemplo
const mdLinks = require("md-links-extractor");

mdLinks("./some/example.md")
  .then(links => {
    // => [{ file, line, href, text }]
  })
  .catch(err)

mdLinks("./some/example.md", { validate: true })
  .then(links => {
    // => [{ file, line, href, text, ok, status }]
  })
  .catch(err)
  
mdLinks("./some/example.md", { stats: true })
  .then(links => {
    // => [{ total, ok,fails }]
  })
  .catch(console.error);

mdLinks("./some/dir")
  .then(links => {
    // => [{ href, text, file }]
  })
  .catch(console.error);

Demo

files dir

Versiones

0.0.2

  • Se pueden validar los enlaces de archivos individuales o archivos dentro de carpetas
  • Se pueden obtener estadisticas de archivos individuales o archivos dentro de carpetas
  • Muestra los enlaces de un archivo markdown

0.0.1

  • Muestra los enlaces de un archivo markdown

npm

Proyecto publicado en npm

Test

Test implementados con Jest con 95% de cobertura

npm test 

Planeación

Trello

Autor

Estephany Carvajal Hernandez