CLI
To get a full list of options, run following:
$ npx ccht --help
Global Options
--crawler <name>
- Available Values
- node-http,- puppeteer
- Default Value
- node-http
Specify which crawler to use.
NodeHTTP Crawler
Use Node.js' HTTP module and cheerio for crawling. Only checks HTML resources.
Puppeteer Crawler
Use Chrome or Chromium via puppeteer for crawling. Checks HTML and every resources loaded by the browser.
--reporter <name>
- Available Values
- code-frame,- json
- Default Value
- code-frame
Specify which reporter to use.
CodeFrame Reporter
Outputs human friendly result, looks simlar to Jest.
JSON Reporter
Outputs JSON. Useful for integration or programatic usage.
--include <urls>
- Available Values
- Comma separated list of URL
- Default Value
- Entrypoint URL
URLs to check. ccht ignores URLs does not match to these URLs.
info
ccht uses forward matching.
--exclude <urls>
- Available Values
- Comma separated list of URL
URLs to ignore. ccht ignores URLs matches to these URLs.
info
ccht uses forward matching.
--expected-status <list>
- Available Values
- Comma separated list of HTTP status code
- Default Value
- 200
Expected HTTP status codes.
--exit-error-severity <severity>
- Available Values
- debug,- info,- warning,- danger
- Default Value
- danger
ccht will exit with 1 (error status) when one or more of result's serverity matches to the value.
How ccht determines severity
- Matches ... OK(DEBUG)
- Does not match but 3xx ... REDIRECT(INFO)
- Does not match ... UNEXPECTED_STATUS(DANGER)
Crawler Options
--timeout <ms>
- Available for
- NodeHTTP, Puppeteer
- Available Values
- Number (ms)
- Default Value
- 3000(3s)
Specifies timeout value for each pages.
--concurrency <max>
- Available for
- NodeHTTP, Puppeteer
- Available Values
- Number (integer, greater than 0)
- Default Value
- 1
Sets max crawling concurrency.
--useragent <string>
- Available for
- NodeHTTP
- Available Values
- String
- Default Value
- ccht/[version number]
Sets UserAgent string used by NodeHTTP Crawler.
--wait-until <type>
- Available for
- Puppeteer
- Available Values
- String
waitUntil option for puppeteer's page.goto method.
Reporter Options
--report-type <type>
- Available for
- CodeFrame, JSON
- Available Values
- ok,- redirect,- unexpected_status,- error
Sets which result type to report. Setting this option will disable --report-severity option.
--report-severity <severity>
- Available for
- CodeFrame, JSON
- Available Values
- debug,- info,- warning,- danger
- Default Value
- danger,warning,info
Sets which result severity to report.
--json-pretty
- Available for
- JSON
Enables pretty-print JSON.
--code-frame-full-referrer
- Available for
- CodeFrame
Always show all referrers.