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

mysticbel-mdlinks

v0.1.0

Published

This library allows you to find links within markdown files, filter them in an array, validate them, provide statistics and look for broken links. Project for Laboratoria

Downloads

2

Readme

Markdown Links 🔗 ✨

`
█████████████████████████████████████████████████████████████
███████████             Welcome to             ██████████████
███████████ █▀▄▀█ █▀▀▄ ░░ █░░ ░▀░ █▀▀▄ █░█ █▀▀ ██████████████
███████████ █░▀░█ █░░█ ▀▀ █░░ ▀█▀ █░░█ █▀▄ ▀▀█ ██████████████
███████████ ▀░░░▀ ▀▀▀░ ░░ ▀▀▀ ▀▀▀ ▀░░▀ ▀░▀ ▀▀▀▒██████████████
█████████████████████████████████████████████████████████████
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░▄▄▄▄█▀▀▀░░░░░░░░░░░░▀▀██░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░▄███▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█▄▄▄░░░░░░░░   . . .   ░░░
░░░░░░▄▀▀░█░░░░▀█▄▀▄▀██████░▀█▄▀▄▀████▀░░░░░░░░   aw      ░░░
░░░░░░█░░░█░░░░░░▀█▄█▄███▀░░░░▀▀▀▀▀▀▀░▀▀▄░░░░░░ yeaah !!  ░░░
░░░░░░█░░░█░▄▄▄░░░░░░░░░░░░░░░░░░░░░▀▀░░░█░░░░░   . . .   ░░░
░░░░░░█░░░▀█░░█░░░░▄░░░░▄░░░░░▀███▀░░░░░░░█░░░░░░░░░░░░░░░░░░
░░░░░░█░░░░█░░▀▄░░░░░░▄░░░░░░░░░█░░░░░░░░█▀▄░░░░░░░░░░░░░░░░░
░░░░░░░▀▄▄▀░░░░░▀▀▄▄▄░░░░░░░▄▄▄▀░▀▄▄▄▄▄▀▀░░█░░░░░░░░░░░░░░░░░
░░░░░░░█▄░░░░░░░░░░░░▀▀▀▀▀▀▀░░░░░░░░░░░░░░█░░░░░░░░░░░░░░░░░░
░░░░░░░░█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▄██░░░░░░░░░░░░░░░░░░░
░░░░░░░░▀█▄░░░░░░░░░░░░░░░░░░░░░░░░░▄▀▀░░░▀█░░░░░░░░░░░░░░░░░`

Index


1. About md-links

Markdown is a very popular lightweight markup language among developers. It is used in many platforms that handle plain text (GitHub, forums, blogs, ...), and it is very common to find several files in that format in any type of repository (starting with the traditional README.md).

These Markdown files usually contain links that are often broken or no longer valid and that greatly damages the value of the information that you want to share.

In this project, md-links is an executable that reads and analyzes files in Markdown format, to verify the links they contain and report some statistics.

Options:

  • --validate (OK, Fail)
  • --stats (total, unique, broken)

2. How to install mdLinks?

⬇️Install :

Install this library with this command :

npm install mysticbel-mdlinks

or you can also download it from github:

npm install mysticbel/LIM015-md-links

🔍Usage:


// Usage: 
  md-links <path-to-file> [options]

// Commands:
  --v, --validate       Show validate links, makes an HTTP request to find out if the link works or not
  --s, --stats          Show basic statistics about links
  --v --s               Show statistics about links : total, unique, broken
  --validate --stats    Show statistics about links : total, unique, broken
  
// Global options:
  -h, --help            display help for command

Options:

--validate

If we pass the --validate option, the module must make an HTTP request to find out if the link works or not. If the link results in a redirect to a URL that responds ok, then we will treat the link as ok.

Example: validate

--stats

If we pass the --stats option, the output will be a text with basic statistics about the links.

Example: stats

We can also combine --stats and --validate to obtain needed statistics from the validation results.

val&stats

--help

If we pass the --help option, the output will be a help menu with all commands.

help

other option

If we pass a non existant option, the output will be a help menu with an 'invalid command' message.

opt-not-valid

What if we put a wrong path or a non-existance file?

the output will be a 'links not found' message and the path doesn't exist.

image6-wrong-path

What if we put a path without an option?

the output will be a an array with all the links extrated fro the file.

image7-no-opt

3. Flowchart

CLI

4. Backlog & Planning

I love using Github Projects !! 😍

backlog

5. Learning Objectives

...

Checklist

General

  • [ ] Can be installed via npm install --global <github-user>/md-links

README.md

  • [✔️🐳] A board with the backlog for the implementation of the library.
  • [✔️🐳] Technical documentation of the library.
  • [✔️🐳] Library installation and use guide.

API mdLinks(path, opts)

  • [✔️🐼] The module exports a function with the expected interface (API).
  • [✔️🐼] Implement single file support.
  • [✔️🐼] Implement directory support.
  • [✔️🐼] Implement options.validate

CLI

  • [✔️🦄] Exposes executable md-links in the path (configured in package.json)
  • [✔️🦄] Runs without errors / expected output
  • [✔️🦄] Implement --validate
  • [✔️🦄] Implement --stats

Unit tests

  • [✔️🐱] Unit tests cover a minimum of 70% of statements, functions, lines, and branches.
  • [✔️🐱] Pass tests (and linters) (npm test).

test

NodeSchool workshoppers

Otros recursos

image 'md-links' is a project done by Maribel Maza for Laboratoria , October 2021 🤗