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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gabrielapiovezan/md-links

v1.0.2

Published

## Biblioteca de leitura de links contidos em arquivos Markdown.

Readme

Markdown Links

Índice

1. Prefácio

O md-links é uma biblioteca que lê arquivos no formato markdown(.md) e retorna os links encontrados neles.

2. Funcionalidade

A biblioteca quando requisitada, necessita dos parâmetros:

-Path: Rota da pasta ou arquivo de necessita fazer a busca).

  • Validate:(Opcional) Para verificar o status de cada link
  • Stats: (Opcional) Para verificar as estatísticas dos dados.
  • Também pode-se combinar os parâmetros Validate e Stats para acrescentar nas estatísticas os dados do status da validação.

CLI

A biblioteca pode ser utilizada com linha de comando através do terminal, onde options pode ser: --stats ou -s --validate ou -v

Exemplos:

md-links <path-to-file> [options]

$ md-links ./some/example.md
./some/example.md http://algo.com/2/3/ Link de algo
./some/example.md https://outra-coisa-.net/algum-doc.html algum doc
./some/example.md http://google.com/ Google
--validate ou -v
$ md-links ./some/example.md --validate
./some/example.md http://algo.com/2/3/ ok 200 Link de algo
./some/example.md https://outra-coisa-.net/algum-doc.html fail 404 algum doc
./some/example.md http://google.com/ ok 301 Google
--stats ou -s
$ md-links ./some/example.md --stats
Total: 3
Unique: 3
--stats ou -s e --validate ou -v
$ md-links ./some/example.md -s -v
Total: 3
Unique: 3
Broken: 1

Scripts no Node-js

O modulo pode ser importado para ser utilizado em scripts do Node-js através de uma requisição.

Exemplos:

const mdLinks = require("md-links");

mdLinks("./some/example.md")
  .then((links) => {
    // => [{ href, text, file }]
  })
  .catch(console.error);
--validate ou -v
const mdLinks = require("md-links");

mdLinks("./some/example.md", { validate: true })
  .then((links) => {
    // => [{ href, text, file, status, ok }]
  })
  .catch(console.error);
--stats ou -s
const mdLinks = require("md-links");

mdLinks("./some/example.md", { stats: true })
  .then((links) => {
    // => { Total: 4, Unique: 2 }
  })
  .catch(console.error);
--stats ou -s e --validate ou -v
const mdLinks = require("md-links");

mdLinks("./some/example.md", { validate: true, stats: true })
  .then((links) => {
    // => { Total: 4, Unique: 2, Broken:1 }
  })
  .catch(console.error);

3. Instalação

Para a instalação da biblioteca é necessário possuir o Nodejs e o NPM instalados no seu computador.

Para instalação global, execute no terminal:

npm -i -g GabrielaPiovezan/SAP004-md-links

Para instalação local, execute no terminal

npm -i  GabrielaPiovezan/SAP004-md-links

4. Considerações Técnicas

Para a construção da biblioteca foi utilizado o Node-JS através do software Visual Studio Code com o gerenciador de pacotes NPM. A linguagem de programação utilizada foi o JavaScript. Foram utilizadas as seguintes extensões:

  • Jest, para testes síncronos e assíncronos do arquivo raiz.
  • Node-Fetch, Para validação dos links.
  • Commander, para implementação da CLI.