Test create md-links library
npm install ccss-md-linksjs
mdLinks(path [, options])
`
#### Arguments
- path: You can pass absolute or relative path of your directory or file.
- options: Is an object with this values:
- validate: Is a boolean value for active validate links in your files.
#### Return value:
You get a (Promise), when you resolved it you get an (Array) of (Object) with this values:
- href: URL from links in markdown files
- text: Text from links in markdown files
- file: Path of the file where the link was found
#### Example
`js
// ES6
import mdLinks from "ccss-md-links";
// CommonJS
const mdLinks = require("ccss-md-links");
mdLinks("./some/example.md")
.then((links) => {
// => [{ href, text, file }]
})
.catch(console.error);
mdLinks("./some/example.md", { validate: true })
.then((links) => {
// => [{ href, text, file, status, statusText }]
})
.catch(console.error);
mdLinks("dir")
.then((links) => {
// => [{ href, text, file }]
})
.catch(console.error);
`
$3
You can install CLI locally or globally:
`bash
$ npm install ccss-md-links
$ npm install -g ccss-md-links
`
Now, you can try whith this command:
`bash
$ ccss-md-links [options]
`
You can try with npx in Windows OS:
`bash
$ npx ccss-md-links [options]
`
For example:
`bash
$ ccss-md-links ./some/example.md
./some/example.md http://algo.com/2/3/ Link a algo
./some/example.md https://otra-cosa.net/algun-doc.html algún doc
./some/example.md http://google.com/ Google
`
#### OPTIONS
##### -v | --validate
You can pass _validate_ option for check and validate all links in your file or files markdown:
`bash
$ ccss-md-links ./some/example.md -v
$ ccss-md-links ./some/example.md --validate
./some/example.md http://algo.com/2/3/ ok 200 Link a algo
./some/example.md https://otra-cosa.net/algun-doc.html fail 404 algún doc
./some/example.md http://google.com/ ok 301 Google
`
##### -s | --stats
You can pass _stats_ option for get information about all links in your file or files markdown:
`bash
$ ccss-md-links ./some/ -s
$ ccss-md-links ./some/example.md --stats
Total: 3
Unique: 3
`
##### -v -s | --validate --stats
You can pass both option and get more information about all links in your file or files markdown:
`bash
$ ccss-md-links some -v -s
$ ccss-md-links some/example.md --validate --stats
Total: 3
Unique: 3
Broken: 1
``