node package manager


LESS CSS middleware.

Build Status


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.

Where do I get this awesomeness?

Why, npm of course!

npm install lessmagic

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'));

Or with Flatiron, as a Broadway plugin:

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

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


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.

I think this could be awesomer!

Awesome, open an issue! If you're really awesome, send me a pull request!

How do the insides of this thing work?

Check out the docco docs at or read the source!