<NME> readme.md
<BEF> **The less-middleware has recently been updated to version `1.0.2`.**

**If you are seeing an error similar to `TypeError: Arguments to path.join must be strings` please read the [migration guide](https://github.com/emberfeather/less.js-middleware/wiki/Migration-0.1.x-1.0.x) to update your code.**


## Installation

```sh
npm install less-middleware --save
```

## Usage

```js
## Usage

```js
lessMiddleware(source, [{options}], [{parserOptions}], [{compilerOptions}])
```

### Express

var app = express();
app.use(lessMiddleware(__dirname + '/public'));
app.use(express.static(__dirname + '/public'));
```

### `options`

The following options can be used to control the behavior of the middleware:

<table>
    <thead>
        <tr>
            <th>Option</th>
            <th>Description</th>
            <th>Default</th>
        </tr>
    </thead>
    <tbody>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th><code>debug</code></th>
            <td>Show more verbose logging?</td>
            <th><code>force</code></th>
            <td>Always re-compile less files on each request.</td>
            <td><code>false</code></td>
        </tr>
        <tr>
            <th><code>once</code></th>
            <td>Only recompile once after each server restart. Useful for reducing disk i/o on production.</td>
            <td><code>false</code></td>
        </tr>
        <tr>
            <th><code>pathRoot</code></th>
            <td>Common root of the source and destination. It is prepended to both the source and destination before being used.</td>
            <td><code>null</code></td>
        </tr>
            <td>Only recompile once after each server restart. Useful for reducing disk i/o on production.</td>
            <td><code>false</code></td>
        </tr>
        <tr>
            <th><code>pathRoot</code></th>
            <td>Common root of the source and destination. It is prepended to both the source and destination before being used.</td>
            <th><code>preprocess</code></th>
            <td>Object containing functions relevant to preprocessing data.</td>
            <td></td>
        </tr>
        <tr>
            <th><code>preprocess.less</code></th>
            <td>Function that modifies the raw less output before being parsed and compiled.</td>
            <td><code>function(src, req){...}</code></td>
        </tr>
        <tr>
            <th><code>preprocess.path</code></th>
            <td>Function that modifies the less pathname before being loaded from the filesystem.</td>
            <td><code>function(pathname, req){...}</code></td>
        </tr>
        <tr>
            <th><code>preprocess.importPaths</code></th>
            <td>Function that modifies the import paths used by the less parser per request.</td>
            <td><code>function(paths, req){...}</code></td>
        </tr>
        <tr>
            <th><code>render</code></th>
            <td>Options for the less render. See the "<code>render</code> Options" section below.</td>
            <td>&hellip;</td>
        </tr>
        <tr>
            <th><code>storeCss</code></th>
            <td>Function that is in charge of storing the css in the filesystem.</td>
            <td><code>function(pathname, css, req, next){...}</code></td>
        </tr>
        <tr>
            <th><code>cacheFile</code></th>
            <td>Path to a JSON file that will be used to cache less data across server restarts. This can greatly speed up initial load time after a server restart - if the less files haven't changed and the css files still exist, specifying this option will mean that the less files don't need to be recompiled after a server restart.</td>
    </tbody>
</table>

## `parserOptions`

The `parserOptions` are passed directly into the less parser with minimal defaults or changes by the middleware.

The following are the defaults used by the middleware:

The following are the defaults used by the middleware:

<table>
    <thead>
        <tr>
            <th>Option</th>
    </thead>
    <tbody>
        <tr>
            <th><code>dumpLineNumbers</code></th>
            <td><code>0</code></td>
        </tr>
        <tr>
            <th><code>paths</code></th>
            <td><code>[source]</code></td>
        </tr>
        <tr>
            <th><code>optimization</code></th>
            <td><code>0</code></td>
        </tr>
        <tr>
            <th><code>relativeUrls</code></th>
            <td><code>false</code></td>
        </tr>
    </tbody>
</table>

## `compilerOptions`

The `compilerOptions` are passed directly into the less parser with minimal defaults or changes by the middleware.

The following are the defaults used by the middleware:

## Troubleshooting

### My less never recompiles, even when I use `{force: true}`!

Make sure you're declaring less-middleware before your static middleware, if you're using the same directory, e.g. (with express):

    </thead>
    <tbody>
        <tr>
            <th><code>compress</code></th>
            <td><code>auto</code></td>
        </tr>
        <tr>
            <th><code>sourceMap</code></th>
            <td><code>false</code></td>
        </tr>
        <tr>
            <th><code>yuicompress</code></th>
            <td><code>false</code></td>
        </tr>
    </tbody>
### IIS

If you are hosting your app on IIS you will have to modify your `web.config` file in order to allow NodeJS to serve your CSS static files.  IIS will cache your CSS files, bypassing NodeJS static file serving, which in turn does not allow the middleware to recompile your LESS files.

<MSG> Updating the readme to show the correct compiler and parser options.

<DFF> @@ -1,4 +1,4 @@
-**The less-middleware has recently been updated to version `1.0.2`.**
+**The less-middleware has recently been updated to version `1.0.3`.**
 
 **If you are seeing an error similar to `TypeError: Arguments to path.join must be strings` please read the [migration guide](https://github.com/emberfeather/less.js-middleware/wiki/Migration-0.1.x-1.0.x) to update your code.**
 
@@ -15,7 +15,7 @@ npm install less-middleware --save
 ## Usage
 
 ```js
-lessMiddleware(source, [{options}], [{parserOptions}], [{compilerOptions}])
+lessMiddleware(source, [{options}])
 ```
 
 ### Express
@@ -41,6 +41,11 @@ The following options can be used to control the behavior of the middleware:
         </tr>
     </thead>
     <tbody>
+        <tr>
+            <th><code>compiler</code></th>
+            <td>Options for the less compiler. See the "`compiler` Options" section below.</td>
+            <td>&hellip;</td>
+        </tr>
         <tr>
             <th><code>debug</code></th>
             <td>Show more verbose logging?</td>
@@ -61,6 +66,11 @@ The following options can be used to control the behavior of the middleware:
             <td>Only recompile once after each server restart. Useful for reducing disk i/o on production.</td>
             <td><code>false</code></td>
         </tr>
+        <tr>
+            <th><code>parser</code></th>
+            <td>Options for the less parser. See the "`parser` Options" section below.</td>
+            <td>&hellip;</td>
+        </tr>
         <tr>
             <th><code>pathRoot</code></th>
             <td>Common root of the source and destination. It is prepended to both the source and destination before being used.</td>
@@ -99,9 +109,9 @@ The following options can be used to control the behavior of the middleware:
     </tbody>
 </table>
 
-## `parserOptions`
+## `compiler` Options
 
-The `parserOptions` are passed directly into the less parser with minimal defaults or changes by the middleware.
+The `options.compiler` is passed directly into the less parser with minimal defaults or changes by the middleware.
 
 The following are the defaults used by the middleware:
 
@@ -114,27 +124,23 @@ The following are the defaults used by the middleware:
     </thead>
     <tbody>
         <tr>
-            <th><code>dumpLineNumbers</code></th>
-            <td><code>0</code></td>
-        </tr>
-        <tr>
-            <th><code>paths</code></th>
-            <td><code>[source]</code></td>
+            <th><code>compress</code></th>
+            <td><code>auto</code></td>
         </tr>
         <tr>
-            <th><code>optimization</code></th>
-            <td><code>0</code></td>
+            <th><code>sourceMap</code></th>
+            <td><code>false</code></td>
         </tr>
         <tr>
-            <th><code>relativeUrls</code></th>
+            <th><code>yuicompress</code></th>
             <td><code>false</code></td>
         </tr>
     </tbody>
 </table>
 
-## `compilerOptions`
+## `parser` Options
 
-The `compilerOptions` are passed directly into the less parser with minimal defaults or changes by the middleware.
+The `options.parser` is passed directly into the less parser with minimal defaults or changes by the middleware.
 
 The following are the defaults used by the middleware:
 
@@ -147,15 +153,19 @@ The following are the defaults used by the middleware:
     </thead>
     <tbody>
         <tr>
-            <th><code>compress</code></th>
-            <td><code>auto</code></td>
+            <th><code>dumpLineNumbers</code></th>
+            <td><code>0</code></td>
         </tr>
         <tr>
-            <th><code>sourceMap</code></th>
-            <td><code>false</code></td>
+            <th><code>paths</code></th>
+            <td><code>[source]</code></td>
         </tr>
         <tr>
-            <th><code>yuicompress</code></th>
+            <th><code>optimization</code></th>
+            <td><code>0</code></td>
+        </tr>
+        <tr>
+            <th><code>relativeUrls</code></th>
             <td><code>false</code></td>
         </tr>
     </tbody>

{'addition_count': 30, 'commit_subject': 'Updating the readme to show the correct compiler and parser options.', 'deletion_count': 20, 'file_extension': '.md', 'lang': 'md', 'license': 'mit', 'repo_name': 'emberfeather/less.js-middleware'}