lessmagic

LESS CSS middleware.

lessmagic

lessmagic is here to make using LESS CSS LESS of a pain. (pardon the pun) It is a Connect/Union middleware and Flatiron plugin that serves autogenerated .css files from your .less files.

How do I use this awesomeness?

Well, you just use it as middleware!

with Express:

var http = require('http');
var express = require('express');
var lessmagic = require('lessmagic');
 
var app = express();
 
app.use(lessmagic(__dirname + '/markup'));
app.use(express.static(__dirname + '/public'));
 
http.createServer(app).listen(3000);

Or with Flatiron, as a Broadway plugin:

var flatiron = require('flatiron');
var lessmagic = require('lessmagic');
 
var app = flatiron.app;
app.use(flatiron.plugins.http);
 
app.use(lessmagic, __dirname + '/markup');
app.use(flatiron.plugins.static, __dirname + '/public');
 
app.start(3000);

There's also a bunch of examples for other frameworks.

lessmagic(opts)

lessmagic(path, opts)

Returns the lessmagic middleware. opts will be passed along to the less.Parser. If path is given, it is prepended to opts.paths.