Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toogle/express-less
On-the-fly LESS-to-CSS conversion middleware
https://github.com/toogle/express-less
css express expressjs less lesscss middleware
Last synced: 3 months ago
JSON representation
On-the-fly LESS-to-CSS conversion middleware
- Host: GitHub
- URL: https://github.com/toogle/express-less
- Owner: toogle
- License: gpl-3.0
- Created: 2013-08-04T22:11:39.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-07-31T14:21:26.000Z (over 8 years ago)
- Last Synced: 2024-04-15T00:47:35.129Z (9 months ago)
- Topics: css, express, expressjs, less, lesscss, middleware
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/express-less
- Size: 30.3 KB
- Stars: 8
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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 }));
```You can enable the cache system to improve performance:
```js
app.use('/less-css', expressLess(__dirname + '/less', { cache: 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'
}));
```## Tests
$ npm test
# License
Copyright (C) 2016 Andrew A. Usenok <[email protected]>
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 .