md-link-checker

0.1.2 • Public • Published

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

Package Sidebar

Install

npm i md-link-checker

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

7.67 kB

Total Files

6

Last publish

Collaborators

  • zmilanov