express-stylus
v0.1.1
Published
Express middleware for Stylus
Downloads
55
Readme
express-stylus
Extended version of Stylus middleware with support for use
and import
inside options.
Install
npm install express-stylus
Options
These options are taken from the official website and supported
force
Always re-compilesrc
Source directory used to find .styl filesdest
Destination directory used to output .css files when undefined defaults tosrc
.compress
Whether the output .css files should be compressedfirebug
Emits debug infos in the generated css that can be used by the FireStylus Firebug pluginlinenos
Emits comments in the generated css indicating the corresponding stylus linesourcemap
Generates a sourcemap in sourcemaps v3 format
Extra options supported by this middleware:
use
: An array of initialized functionsimport
: An array of Stylus module names
Example
var express = require('express');
var stylus = require('express-stylus');
var nib = require('nib');
var join = require('path').join;
var publicDir = join(__dirname, '/public');
var app = express();
app.use(stylus({
src: publicDir,
use: [nib()],
import: ['nib']
}));
app.use(express.static(publicDir));
app.listen(80);
Now create a test.styl
inside public
folder and visit localhost/test.css
in browser.