1.0.0 • Published 8 years ago

stylish v1.0.0

Weekly downloads
199
License
zlib
Repository
github
Last release
8 years ago

node-stylish npm version Build Status

Simple node.js stylus middleware for connect (or express) 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 in this example):

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:

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):

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

License

zlib license LICENSE.

1.0.0

8 years ago

0.6.0

9 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago