@@ -68,6 +68,12 @@ The callback function is passed a results object, containing the following keys:
...
@@ -68,6 +68,12 @@ The callback function is passed a results object, containing the following keys:
*`css` - The compiled CSS. Write this to a file, or serve it out as needed.
*`css` - The compiled CSS. Write this to a file, or serve it out as needed.
*`map` - The source map
*`map` - The source map
*`stats` - An object containing information about the compile. It contains the following keys:
*`entry` - The path to the scss file, or `data` if the source was not a file
*`start` - Date.now() before the compilation
*`end` - Date.now() after the compilation
*`duration` - *end* - *start*
*`includedFiles` - Absolute paths to all related scss files in no particular order.
#### error
#### error
`error` is a `Function` to be called upon occurrence of an error when rendering the scss to css. This option is optional, and only applies to the render function. If provided to renderSync it will be ignored.
`error` is a `Function` to be called upon occurrence of an error when rendering the scss to css. This option is optional, and only applies to the render function. If provided to renderSync it will be ignored.
...
@@ -174,20 +180,6 @@ console.log(result.map);
...
@@ -174,20 +180,6 @@ console.log(result.map);
console.log(result.stats);
console.log(result.stats);
```
```
The stats object consists of the following constituents:
```javascript
{
entry:"path/to/entry.scss",// or just "data" if the source was not a file
start:10000000,// Date.now() before the compilation
end:10000001,// Date.now() after the compilation
duration:1,// end - start
includedFiles:[...]// absolute paths to all related scss files
}
```
Note: `includedFiles` isn't sorted in any meaningful way, it's just a list of all imported scss files including the entry.
### Sepecial behaviours
### Sepecial behaviours
* In the case that both `file` and `data` options are set, node-sass will give precedence to `data` and use `file` to calculate paths in sourcemaps.
* In the case that both `file` and `data` options are set, node-sass will give precedence to `data` and use `file` to calculate paths in sourcemaps.