Using in a Node.js Application

Jackson Ray Hamilton edited this page Jul 1, 2016 · 3 revisions

To run CSSLint from within a Node.js application, use the following:

var CSSLint = require('csslint').CSSLint;
var result = CSSLint.verify("h1 { color: red; }");
result.messages.forEach(function (message) {
    console.log("%s (line %d, col %d): %s", message.type, message.line, message.col, message.message);
});