# connect-css-to-less-fallback

> Connect middleware providing a fallback for missing CSS files to corresponding LESS files

Latest version **0.0.1** (published 2015-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install connect-css-to-less-fallback
pnpm add connect-css-to-less-fallback
yarn add connect-css-to-less-fallback
bun add connect-css-to-less-fallback
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-04-06 |
| First published | 2015-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andreas Helmberger |
| Maintainers | ahelmberger |

## Links

- npm: https://www.npmjs.com/package/connect-css-to-less-fallback
- Repository: https://github.com/ahelmberger/connect-css-to-less-fallback
- Issues: https://github.com/ahelmberger/connect-css-to-less-fallback/issues
- npm.io page: https://npm.io/package/connect-css-to-less-fallback

## Dependencies (2)

- [less](https://npm.io/package/less.md) ^2.5.0
- [cssesc](https://npm.io/package/cssesc.md) ^0.1.0

## Recent versions

- 0.0.1 (latest) — 2015-04-06

## README

# connect-css-to-less-fallback

Connect middleware providing a fallback for missing CSS files to corresponding LESS files

__PLEASE NOTE: You should use this only during development. For production LESS should be precompiled.__

## How it works

This middleware checks for each request:

1. Determines if requested file is a CSS file.
2. If yes, looks for the requested CSS file.
3. If not found, looks for a LESS file with the same name.
4. If found, compiles the LESS file and delivers it, ending the request.

In all other cases, it just calls `next()` and finishes processing.

## Usage

Use [NPM](http://npmjs.org) to install `connect-css-to-less-fallback`:

    npm install connect-css-to-less-fallback --save

Then load it in your app:

    var express = require('express');
    var cssToLessFallback = require('connect-css-to-less-fallback');
    var app = express();

    // just use it with the default options
    app.use(cssToLessFallback());

## What options are available?

You can provide an options object to the `cssToLessFallback` function:

    app.use(cssToLessFallback({
      // the website root folder (default: '.')
      root: './public',
      // any less plugin you want to use (default: [])
      plugins: [autoPrefix],
      // if set to true true, it embeds sourcemaps (default: false)
      sourceMap: true
    }));

## Changelog

__0.0.1__ Initial version

---
Licensed under the MIT license

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