connect-less-jolira
Version:
Yet another connect handler implementation for less
44 lines (29 loc) • 1.31 kB
Markdown
Yet Another connect-less [](http://travis-ci.org/jolira/connect-less-jolira)
========================================================================================================================
The other existing [less](lesscss.org) handlers for connect.js did not quite work for the
[site-manager](https://github.com/jolira/site-manager). We needed a bit more flexibility than
the other implementations had.
This version supports passing multiple directories, which are all searched for less files. The
less files are compiled when requested the first time, unless debugging is enabled.
## Installation
```
npm install connect-less-jolira
```
## Example
Search for .less files in ``/var/www`` and ``/home/fido/www``:
```
var connect = require("connect"),
less = require("connect-less-jolira"),
app = connect.createServer();
app.use(less(["/var/www", "/home/fido/www"]));
```
Any file with extenstion ``.less`` will be compiled on-demand and returned as ``text/css`. E.g.
'''
<link rel="stylesheet" href="twitterbootstrap/less/bootstrap.less">
<link rel="stylesheet" href="twitterbootstrap/less/responsive.less">
'''
## Logs
Logs can be turned on using:
```
export NODE_DEBUG="connect-less"
```