w3cvalidator
0.1.26 • Public • Published w3cvalidator
A node.js library for testing files or url's against the w3c html and css validator.
Forked from https://github.com/thomasdavis/w3cjs
Installation
Usage
var w3cvalidator = require('w3cvalidator');
var results = w3cvalidator.validate({
file: 'style.css',
output: 'json',
doctype: 'HTML5',
charset: 'utf-8',
callback: function (res) {
console.log(res);
},
validate: 'css',
profile: 'css3',
medium: 'all',
warnings: 'no'
});
Example async testing with Mocha
var w3cvalidator = require('w3cvalidator');
describe('html and css validation', function(){
it('index page should have no html errors', function(done){
w3cvalidator.validate({
file: 'index.html',
callback: function (res) {
console.log(res);
if (res.messages.length > 0 ) {
throw {error: 'html errors have been found', results: res};
};
done();
}
})
})
})
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads