HTMLLint is a JavaScript-based HTML Linter based on HTMLMinifier.
Test suite is available online.
From NPM for programmatic use:
npm install html-minifier-lint
From Git:
git clone git://github.com/kangax/html-lint.git
cd html-lint
npm link .
For command line usage please see html-minifier-lint --help
var lint = require('html-minifier-lint').lint;
var result = lint('<p title="blah" id="moo">foo</p>');
result; // ' - No DOCTYPE found.'