# express-less

> On-the-fly LESS-to-CSS conversion middleware

Latest version **0.1.0** (published 2016-07-31) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install express-less
pnpm add express-less
yarn add express-less
bun add express-less
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-07-31 |
| First published | 2013-08-07 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | separate (@types/express-less) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Andrew A. Usenok |
| Maintainers | toogle |
| Keywords | express, less, css |

## Links

- npm: https://www.npmjs.com/package/express-less
- Repository: https://github.com/toogle/express-less
- Homepage: https://github.com/toogle/express-less#readme
- Issues: https://github.com/toogle/express-less/issues
- npm.io page: https://npm.io/package/express-less

## Dependencies (1)

- [less](https://npm.io/package/less.md) >=2.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2016-07-31
- 0.0.8 — 2015-07-28
- 0.0.7 — 2015-04-25
- 0.0.6 — 2014-11-26
- 0.0.5 — 2014-11-12
- 0.0.4 — 2014-09-03
- 0.0.3 — 2014-05-16
- 0.0.2 — 2013-08-18
- 0.0.1 — 2013-08-07

## README

# Express LESS

On-the-fly LESS-to-CSS conversion middleware.

For more information on LESS visit [lesscss.org](http://lesscss.org/).

## Installation

    $ npm install express-less

## Usage

```js
var express = require('express'),
    expressLess = require('express-less');

var app = express();
app.use('/less-css', expressLess(__dirname + '/less'));
```
Now request to */less-css/styles.css* will return rendered contents of *./less/styles.less*.
**Note the change of file extension from `.less` to `.css`.**

Additionally, you can ask LESS to compress the result:

```js
app.use('/less-css', expressLess(__dirname + '/less', { compress: true }));
```

For detail information on LESS errors use the `debug` option, e.g.

```js
// Enable error reporting permanently
app.use('/less-css', expressLess(__dirname + '/less', { debug: true }));

// or only for development environment
app.use('/less-css', expressLess(__dirname + '/less', {
    debug: app.get('env') == 'development'
}));
```

You can enable the cache system to improve performance:

```js
app.use('/less-css', expressLess(__dirname + '/less', { cache: true }));
```

## Tests

    $ npm test

# License

Copyright (C) 2015 Andrew A. Usenok &lt;tooogle@mail.ru&gt;

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

---
_Source: https://npm.io/package/express-less · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
