A CLI interface for the Nu HTML Checker
% npm install -g nu-html-checker
Usage: cli [options] <files/urls ...>
Options:
-h, --help output usage information
-V, --version output the version number
-f, --formatter <formatter> Choose the formatter to use. (stylish, json)
var checker = require('nu-html-checker');
var batch = checker.validate([ 'test.html', 'http://google.com' ]);
batch.on('progress', function (e) {
console.log(checker.format('stylish', e.value), '\n');
});
batch.on('end', function (err) {
if (err) console.error(err.stack);
})When list is an array of strings, they can be either URLs or file paths. They
will all be processed in parallel.
If list is supplied as anything else, (such as a string, stream or buffer) it
will be validated as an individual item.
- api
StringThe root URL for the endpoint to use (default: https://validator.nu/) - level
BooleanIf set tofalse, then all messages will be returned (default: only errors) - formatter
StringMust correspond to a named formatter (see below)
The object returned is an instance of Batch
which needs to be interacted with directly. You must at least call
batch.end(callback), but you can optionally add a batch.on('progress')
handler.
Formats the given results with the formatter matching the given name. (can
either be "stylish" or "json")
Formats as colored terminal text.
Formats as pretty-printed JSON.