0.1.1 • Published 6 years ago
express-stylus v0.1.1
express-stylus 
Extended version of Stylus middleware with support for use and import inside options.
Install
npm install express-stylusOptions
These options are taken from the official website and supported
forceAlways re-compilesrcSource directory used to find .styl filesdestDestination directory used to output .css files when undefined defaults tosrc.compressWhether the output .css files should be compressedfirebugEmits debug infos in the generated css that can be used by the FireStylus Firebug pluginlinenosEmits comments in the generated css indicating the corresponding stylus linesourcemapGenerates 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.