Giter Club home page Giter Club logo

check-md's Introduction

check-md

NPM version build status Test coverage David deps Known Vulnerabilities NPM download

A simple cli for checking dead links of markdown.

Usage

$ npm i check-md --save
$ npx check-md

Options

Usage: check-md [options]

Options:
  -v, --version            output the version number
  -f, --fix                Check and try to fix
  -c, --cwd [path]         Working directory of check-md, default to process.cwd()
  -r, --root [path]        Checking url root, default to ./
  -p, --preset [name]      Preset config(eg vuepress, default)
  -P, --pattern [pattern]  Glob patterns, default to **/*.md
  -i, --ignore [pattern]   Ignore patterns, will merge to pattern, default to **/node_modules
  --exit-level [level]     Process exit level, default to error, other choice is warn and none, it will not exit if setting to none
  --default-index [index]  Default index in directory, default to README.md,readme.md
  -h, --help               output usage information

configure in package.json

{
  "check-md": {
    "cwd": "./",
    "defaultIndex": [ "index.md" ],
    "exitLevel": "warn",
  }
}

Example

Running cli in directory of test.md

The result is

Checking markdown...

1 warning was found

  Should use .md instead of .html: [test6](./other.html#ctx-get-name) (/Users/Workspace/check-md/test/fixtures/docs1/test.md:15:1)


5 dead links was found

  Url link is empty: [test1]() (/Users/Workspace/check-md/test/fixtures/docs1/test.md:5:5)
  Hash is not found: [test8](/other#cccc) (/Users/Workspace/check-md/test/fixtures/docs1/test.md:19:1)
  File is not found: [test9](/123.md#cccc) (/Users/Workspace/check-md/test/fixtures/docs1/test.md:21:1)
  Hash should slugify: [test12](./other.md#ctx.get(name) (/Users/Workspace/check-md/test/fixtures/docs1/test.md:27:1)
  File is not found: [test16](./123.md#ctx.get(name) (/Users/Workspace/check-md/test/fixtures/docs1/test.md:39:1)

Executes with --fix to fix automatically

Checking failed

check-md's People

Contributors

whxaxes avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.