@mapbox/vnu-validate-html

0.1.0 • Public • Published

@mapbox/vnu-validate-html

Build Status

🚧🚧 WORK IN PROGRESS! 🚧🚧

Validate static HTML with the Nu Html Checker.

Uses vnu-jar, so requires a Java 8 environment.

More tests and options could be added, and more edge cases anticipated (e.g. type: 'info' warnings).

API

validate

validate(glob: string | Array<string>, options?: Object)

glob is passed to globby to find your files.

Options (none required)

  • stripColors boolean - Default: false. If true, colors are stripped from the report.
const vnuValidateHtml = require('@mapbox/vnu-validate-html');

vnuValidateHtml.validate(myFilesGlob)
  .then(report => console.log(report))
  .catch(/* ... */);

CLI

The CLI allows you to run validate and log the report.

Run vnu-validate-html --help for details.

Alternatives

html-validator and html-validator-cli validate your HTML through Validator.nu's Web Service Interface. You don't need Java to run those. But you might hit rate limits on the API, if you validate a lot of HTML files frequently.

Package Sidebar

Install

npm i @mapbox/vnu-validate-html

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user