0.1.2 • Published 6 years ago

md-link-checker v0.1.2

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

md-link-checker

Check links in markdown even github private ones

Usage

Here is an example call of md-link-checker:

const checkLinks = require('md-link-checker');
const options = {
    files: [
        './test1.md',
        './test2.md',
        './test3.md',
        './test4.json'
    ],
    tokenFilePath: '~/.token'
};

checkLinks(options).then(function (data) {
    return console.log('All links are alive, therefore Zelda will be rescued.');
}).catch(function (data) {
    data.forEach(function (file) {
        return console.log(`Dead links in file ${file.filename} are: \n${file.deadlinks.join('\n')}\n`);
    });
});

The token file should look like this:

{
    "token": "yourGitHubToken"
}

You can also omit the tokenFilePath, but then you can not check private GitHub links. Note:

The token needs at least the full repo scope.

Since this checks only Markdown files, any other filetypes will be skipped.

Grunt Plugin

grunt-md-link-checker