CitlalliDMG / md-links

0 stars 0 forks source link

md-links

School project that develop a Command line tool used to extract links from texts in markdown format and checks whether each link is alive (200 OK) or dead.

Installation

To add the module to your project, run:

npm install CitlalliDMG/md-links

To install the command line tool globally, run:

npm install -g CitlalliDMG/md-links

If you get a permission error please try using sudo (you may need admin permissions depending on your node installation).

# using `sudo` (only if the previous step failed)
sudo npm i -g CitlalliDMG/md-links

Also if you want, you can install using a local clone.

# clone from your own fork
git clone git@github.com:<your-username>/md-links.git
cd md-links
npm install
npm link

If the above command fails, try using sudo:

sudo npm link

Uninstalling

To remove the module globally, run:

npm uninstall -g CitlalliDMG/md-links

API

mdLinks(path, options)

Given a string path containing markdown formatted text extract all of the http links and check if they're alive or dead.

Parameters:

Command Line Tool

The command line tool by default expects one argument the file name (will soon accept directories) or either of the options --version or --help.

If a file name is supplied, the command line optionally takes 1 or 2 extra arguments (--validate or --stats)

If neither of the arguments is supplied, the tool displays the usage information.

Examples

Check links from a local markdown file

mdLinks + path

Check links from a local markdown file and validate

mdLinks + path

Check links from a local markdown file and stats

mdLinks + path

Check links from a local markdown folder (recursive)

Soon

Usage


  Usage: mdLinks <path-to-file> [options]

  Options:

    --version           display version number of the package

    --validate          makes an HTTP request to find out if the link works or not,
                        showing in the output the path to the md file, the URL tested,
                        the response of the request and the status

    --stats             display basic statistics of the links found in the file (total and number of unique links)

    --help              output usage information

Module

Available soon

Testing

npm test

Checklist

General

That is installable directly from the Github repository

README.md

API mdLinks(path, opts)

CLI

Tests