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

sofilovelace-md-links

v1.0.1

Published

npm library developed to validate search for md files within a directory, find the links in md format and check if they are still valid

Downloads

12

Readme

sofilovelace-md-links

GitHub package.json version npm Tests

The solution to review the links contained in the markdown documentation of our projects. Find repeated links, dead links, and get statistics quickly Markdown.

Installation

Installation via npm

npm install sofilovelace-md-links -g

Installation via github

git clone https://github.com/SofiLovelace/DEV003-md-links.git

Quick Start

You can run the module directly from powershell or your preferred terminal, you just have to go to the path where the file or directory to validate and execute is located: md-links. As the first argument, you specify a relative path to a file with the md extension or a directory containing files with the md extension. The program will return an array of objects. md-links <relative path>

Example

In the following example we have a "README.md" file in the root of the project where the dependency is installed.

$ md-links README.md
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   Markdown
  Href   ->   https://es.wikipedia.org/wiki/Markd
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   GitHub package.json version
  Href   ->   https://img.shields.io/github/package-json/v/SofiLovelace/DEV003-md-links?logo=GitHub
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   Tests
  Href   ->   https://img.shields.io/badge/test-ok-green

To search for documents in a directory, just pass the relative path of the directory.

Options

The program admits 3 options: validate, stats and brokens.

--validate

When executing the program with the validate option, the dependency will perform an http query, and will return information about the status of our links. md-links <relative path> --validate

Example
$ md-links README.md --validate
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   Markdown
  Href   ->   https://es.wikipedia.org/wiki/Markd
  Status ->   404
  Ok     ->   fail
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   GitHub package.json version
  Href   ->   https://img.shields.io/github/package-json/v/SofiLovelace/DEV003-md-links?logo=GitHub
  Status ->   200
  Ok     ->   ok
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   Tests
  Href   ->   https://img.shields.io/badge/test-ok-green
  Status ->   200
  Ok     ->   ok

--stats

When running the program with the stats option, the dependency will return information about our links and quick stats. md-links <relative path> --stats

Example
$ md-links README.md --stats
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   Markdown
  Href   ->   https://es.wikipedia.org/wiki/Markd
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   GitHub package.json version
  Href   ->   https://img.shields.io/github/package-json/v/SofiLovelace/DEV003-md-links?logo=GitHub
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   Tests
  Href   ->   https://img.shields.io/badge/test-ok-green

******STATS*******
  -> Total: 3
  -> Unique: 3

--validate --stats

We can combine the options validate and stats md-links <relative path> --validate --stats

Example
$ md-links README.md --validate --stats
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   Markdown
  Href   ->   https://es.wikipedia.org/wiki/Markd
  Status ->   404
  Ok     ->   fail
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   GitHub package.json version
  Href   ->   https://img.shields.io/github/package-json/v/SofiLovelace/DEV003-md-links?logo=GitHub
  Status ->   200
  Ok     ->   ok
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   Tests
  Href   ->   https://img.shields.io/badge/test-ok-green
  Status ->   200
  Ok     ->   ok

******STATS*******
  -> Total:  3
  -> Unique: 3
  -> Broken: 1

--validate --stats --brokens

We can add the brokens option, and we will be able to easily find out about our broken links md-links <relative path> --validate --stats --brokens

Example
$ md-links README.md --validate --stats --brokens
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   Markdown
  Href   ->   https://es.wikipedia.org/wiki/Markd
  Status ->   404
  Ok     ->   fail
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md  
  Text   ->   GitHub package.json version
  Href   ->   https://img.shields.io/github/package-json/v/SofiLovelace/DEV003-md-links?logo=GitHub
  Status ->   200
  Ok     ->   ok
=================================================================================================================================
  File   ->   C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  Text   ->   Tests
  Href   ->   https://img.shields.io/badge/test-ok-green
  Status ->   200
  Ok     ->   ok

*******STATS*******
  -> Total:  3
  -> Unique: 3
  -> Broken: 1

******BROKENS******
  ==========================================================================================================================
  > file:  C:\Users\Winney\Documents\desarrollo-web\proyectos laboratoria\Bootcamp\DEV003-md-links\DEV003-md-links\README.md
  > href:  https://es.wikipedia.org/wiki/Markd