# stylish

> Stylus middleware for connect

Latest version **1.0.0** (published 2016-10-15) · zlib license · 0 weekly downloads

## Install

```sh
npm install stylish
pnpm add stylish
yarn add stylish
bun add stylish
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-10-15 |
| First published | 2013-02-20 |
| Weekly downloads | 0 |
| License | zlib |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Marcello Bastéa-Forte |
| Maintainers | marcello |
| Keywords | stylus, middleware, connect |

## Links

- npm: https://www.npmjs.com/package/stylish
- Repository: https://github.com/marcello3d/node-stylish
- Homepage: https://github.com/marcello3d/node-stylish#readme
- Issues: https://github.com/marcello3d/node-stylish/issues
- npm.io page: https://npm.io/package/stylish

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) 2.2.0
- [filewatcher](https://npm.io/package/filewatcher.md) 3.0.1

## 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

- 1.0.0 (latest) — 2016-10-15
- 0.6.0 — 2015-04-23
- 0.5.0 — 2014-10-06
- 0.4.1 — 2013-12-06
- 0.4.0 — 2013-11-29
- 0.3.0 — 2013-03-21
- 0.2.2 — 2013-03-13
- 0.2.1 — 2013-03-12
- 0.2.0 — 2013-03-12
- 0.1.0 — 2013-02-20

## README

node-stylish [![npm version](https://badge.fury.io/js/stylish.svg)](http://badge.fury.io/js/stylish) [![Build Status](https://travis-ci.org/marcello3d/node-stylish.svg?branch=master)](https://travis-ci.org/marcello3d/node-stylish)
============

Simple node.js [stylus](https://github.com/learnboost/stylus) middleware for
[connect](https://github.com/senchalabs/connect) (or [express](http://expressjs.com/)) that doesn't write files to disk.

Install
------

    npm install stylish

Examples
--------

Simple `stylus.middleware()` drop-in replacement:

    app.use(stylish(__dirname + '/public'))

Extended example with stylus compression and an example of customizing the renderer (using
[nib](https://github.com/visionmedia/nib/) in this example):

```js
app.use(stylish({
    src:__dirname + '/public',
    compress: true,
    setup: function(renderer) {
        return renderer.use(nib())
    }
}))
```

By default, stylish watches files (and dependencies) for changes. You can add a callback to learn when a file changes:

```js
app.use(stylish({
    src:__dirname + '/public',
    compress: true,
    watchCallback: function(error, filename) {
        // do something clever, like tell the client to reload css
    }
}))
```

For production use, turn caching on (this caches the computed css in memory and disables file watching):

```js
app.use(stylish({
    src:__dirname + '/public',
    compress: true,
    cache: true
}))
```

License
-------
zlib license [LICENSE](LICENSE).

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