$ npm install -g palomajurado/p-mdlinks
$ npm install @palomania/mdlinks
$ npm install p-mdlinks
$ npm install -g p-mdlinks
$ npx p-mdlinks <path-to-file> [options]
For example:
$ npx p-mdlinks ./some/example.md
./some/example.md http://ubu.com/2/3/ Link to something
./some/example.md https://deco.net/algun-doc.html some file
./some/example.md http://google.com/ Google
-v | --validate
$ npx p-mdlinks ./some/example.md -v
$ npx p-mdlinks ./some/example.md --validate
./some/example.md http://ubu.com/2/3/ ok 200 Link to something
./some/example.md https://deco.net/algun-doc.html fail 404 some file
./some/example.md http://google.com/ ok 301 Google
-s | --stats
$ npx p-mdlinks ./some/ -s
$ npx p-mdlinks ./some/example.md --stats
Total: 3
Unique: 3
-v -s | --validate --stats
$ npx p-mdlinks some -v -s
$ npx p-mdlinks some/example.md --validate --stats
Total: 3
Unique: 3
Broken: 1
// ES6
import mdLinks from 'p-mdlinks';
// CommonJS
const mdLinks = require('p-mdlinks');
mdLinks('src')
.then((res) => console.log('dir without validate: ', res))
.catch(console.log);
mdLinks('./src', { validate: true })
.then((res) => console.log('dir with validate: ', res))
.catch(console.log);
mdLinks('README.md')
.then((res) => console.log('file without validate: ', res))
.catch(console.log);
mdLinks('./README.md', { validate: true })
.then((res) => console.log('file with validate: ', res))
.catch(console.log);
mdLinks('assets')
.then((res) => console.log('dir not exist: ', res))
.catch(console.log);
mdLinks('index.js')
.then((res) => console.log('md not correct: ', res))
.catch(console.log);
mdLinks('reading.md')
.then((res) => console.log('md file not exist: ', res))
.catch(console.log);
Technologies used to create this project.