lessen

Streaming less compiler

npm install lessen
7 downloads in the last week
28 downloads in the last month

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(err, data) {
});

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'));
npm loves you