# nce-sass

> A sass implemention for nce

Latest version **0.0.1** (published 2015-01-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install nce-sass
pnpm add nce-sass
yarn add nce-sass
bun add nce-sass
```

## 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-01-13 |
| First published | 2015-01-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Arne Schubert |
| Maintainers | atd |
| Keywords | cms, nce, middleware, sass |

## Links

- npm: https://www.npmjs.com/package/nce-sass
- Repository: https://github.com/atd-schubert/nce-sass
- Issues: https://github.com/atd-schubert/nce-sass/issues
- npm.io page: https://npm.io/package/nce-sass

## Dependencies (3)

- [MD5](https://npm.io/package/MD5.md) ^1.2.1
- [node-sass](https://npm.io/package/node-sass.md) ^2.0.0-beta
- [underscore](https://npm.io/package/underscore.md) ^1.7.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2015-01-13

## README

# AMD extension for NCE
## Description
A [SASS](http://sass-lang.com/) implementation for [nce framework](https://github.com/atd-schubert/node-nce)

## How to install
Install with npm: `npm install --save nce-sass`

Integrate in NCE with the [extension-manager](https://github.com/atd-schubert/nce-extension-manager):

```
var NCE = require("nce");
var nce = new NCE(/*{}*/);
var extMgr = require("nce-extension-manager")(nce);

var sass = extMgr.getActivatedExtension("sass");
```

## How to use
### Config settings
You are able to use the following [config-settings](https://github.com/atd-schubert/node-nce/wiki/Extension-Class#configuration) (listed with their defaults):

* `route: "/sass"`: Sub-URL to listen
* `dumpPath: process.cwd() + "/sass"`: Directory to dump files
* `cachePath: process.cwd() + "/css-cache"`: Directory to dump rendered css files
* `renderOptions:`: Settings for implemented [node-sass](https://github.com/sass/node-sass#options)
    * `includePaths: dumpPath from above as array`: Array of include paths
    * `outputStyle: compressed`: Settings for compressor
* `logger: {}`: Settings for [logger-extension](https://github.com/atd-schubert/nce-winston)


### Basic methods
#### ext.define(name, code, cb)
Define a sass-resource by its name.

##### Arguments
1. `name`[String]: A name as identifier.
1. `code`[String]: SASS code. 
1. `cb`[Function]: Callback-function form `fs.writeFile` with the arguments:
    1. `error`[Error]: Used for exceptions

#### ext.getSass(name, cb)
Get a defined sass-file.

##### Arguments
1. `name`[String]: A name as identifier
1. `cb`[Function]: Callback-function form `fs.readFile` with the arguments:
    1. `error`[Error]: Used for exceptions
    1. `code`[Buffer]: Content of file as buffer
    
#### ext.getCss(name, cb)
Get a rendered css-file (Note: You have to call ext.render(...) first!).

##### Arguments
1. `name`[String]: A name as identifier
1. `cb`[Function]: Callback-function form `fs.readFile` with the arguments:
    1. `error`[Error]: Used for exceptions
    1. `code`[Buffer]: Content of file as buffer

#### ext.getSassStream(name)
Get the sass resource as a stream.
##### Arguments
1. `name`[String]: A name as identifier

Returns a stream from `fs.createReadStream`.

#### ext.getCssStream(name)
Get the css resource as a stream.
##### Arguments
1. `name`[String]: A name as identifier

Returns a stream from `fs.createReadStream`.

#### ext.undefine(name, cb)
Remove a sass and rendered css from defined sass by its name.

##### Arguments
1. `name`[String]: A name as identifier
1. `cb`[Function]: Callback-function form `fs.readFile` with the arguments:
    1. `error`[Error]: Used for exceptions

#### ext.render(name, cb, opts)
##### Arguments
1. `name`[String]: A name as identifier
1. `cb`[Function]: Callback-function form `fs.readFile` with the arguments:
    1. `error`[Error]: Used for exceptions
    1. `result`[Object]: The result given by [node-sass](https://github.com/sass/node-sass)
1. `opts`[Object]: Options for [node-sass](https://github.com/sass/node-sass#options)

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