lessen

Streaming less compiler

#Lessen

npm install lessen

Lessen is a streaming less.js compiler, because I needed and couldn't find one. It is based on the less.js code, but exports a streamable interface.

##Example

File output is streamed, --yui-compress is enabled by default.

var lessen = require('lessen');
var lessc = new lessen.Compiler({
  fileIn:'in.less',
  fileOut:'out.css',
  compress:false
});
 
lessc.compile(function(errdata) {
});

###Alternate form

Instead of passing options object, just pass input name, output name, and callback. Only input name is required.

lessen.compile('in.less', console.log)

###Streaming

var options = {
  compress:false
};
 
lessen.createStream('butt.less', options).pipe(fs.createWriteStream('out.css'));