node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


The Nu Html Checker (v.Nu) Chat room Download latest

The Nu Html Checker (v.Nu) is the backend of,, and Its source code is available, as are instructions on how to build, test, and run the code.

vnu.jar is a packaged version of the Nu Html Checker for batch-checking documents from the command line and from other scripts/apps.

You can work with vnu.jar in CommonJS modules.

Install latest release version

$ npm install --save vnu-jar

Install latest dev version

$ npm install --save vnu-jar@dev


For Node.js 6+

'use strict';
const exec = require ( 'child_process' ).exec;
const vnu = require ( 'vnu-jar' );
// Print path to vnu.jar
console.log ( vnu );
// Work with vnu.jar
// for example get vnu.jar version
exec ( `java -jar ${vnu} --version`, ( error, stdout ) => {
    if ( error ) {
        console.error ( `exec error: ${error}` );
    console.log ( stdout );
} );


Use the vnu.jar HTML checker as an executable for command-line checking of documents by invoking it like this:

  java -jar ~/vnu.jar [--errors-only] [--Werror] [--exit-zero-always]
       [--asciiquotes] [--no-stream] [--format gnu|xml|json|text]
       [--filterfile FILENAME] [--filterpattern PATTERN] [--html]
       [--skip-non-html] [--no-langdetect] [--help] [--verbose] [--version]

Note: In these instructions, replace "~/vnu.jar" with the actual path to the file on your system.

To check one or more documents from the command line:

  java -jar ~/vnu.jar FILE.html FILE2.html FILE3.HTML FILE4.html...

Note: If you get a StackOverflowError error when using the vnu.jar file, try adjusting the thread stack size by providing the -Xss option to java:

  java -Xss512k -jar ~/vnu.jar FILE.html...

To check all documents in a particular directory:

  java -jar ~/vnu.jar some-directory-name/

To check all documents in a particular directory, skipping any documents whose names don’t end with the extensions .html, .htm, .xhtml, or .xht:

  java -jar ~/vnu.jar --skip-non-html some-directory-name/

To check a Web document:

  java -jar ~/vnu.jar _URL_

  example: java -jar ~/vnu.jar

To check standard input:

  java -jar ~/vnu.jar -

  example: echo '<!doctype html><title>...' | java -jar ~/vnu.jar -


When used from the command line as described in this section, the vnu.jar executable provides the following options:


Specifies whether ASCII quotation marks are substituted for Unicode smart
quotation marks in messages.

default: [unset; Unicode smart quotation marks are used in messages]


Specifies that only error-level messages and non-document-error messages are
reported (so that warnings and info messages are not reported).

default: [unset; all message reported, including warnings & info messages]


Makes the checker exit non-zero if any warnings are encountered (even if
there are no errors).

default: [unset; checker exits zero if only warnings are encountered]


Makes the checker exit zero even if errors are reported for any documents.

default: [unset; checker exits 1 if errors are reported for any documents]

--filterfile FILENAME

Specifies a filename. Each line of the file contains either a regular
expression or starts with "#" to indicate the line is a comment. Any error
message or warning message that matches a regular expression in the file is
filtered out (dropped/suppressed).

default: [unset; checker does no message filtering]

--filterpattern PATTERN

Specifies a regular-expression pattern. Any error message or warning message
that matches the pattern is filtered out (dropped/suppressed).

default: [unset; checker does no message filtering]

--format format

Specifies the output format for reporting the results.

default: "gnu"

possible values: "gnu", "xml", "json", "text" [see information at URL below]


Shows detailed usage information.


Skip documents that don’t have *.html, *.htm, *.xhtml, or *.xht extensions.

default: [unset; all documents found are checked, regardless of extension]


Forces any *.xhtml or *.xht documents to be parsed using the HTML parser.

default: [unset; XML parser is used for *.xhtml and *.xht documents]


Disables language detection, so that documents are not checked for missing
or mislabeled html[lang] attributes.

default: [unset; language detection & html[lang] checking are performed]


Forces all documents to be be parsed in buffered mode instead of streaming
mode (causes some parse errors to be treated as non-fatal document errors
instead of as fatal document errors).

default: [unset; non-streamable parse errors cause fatal document errors]


Specifies "verbose" output. (Currently this just means that the names of
files being checked are written to stdout.)

default: [unset; output is not verbose]


Shows the vnu.jar version number.