es

express-stylus

Extended Stylus middleware for Express

Showing:

Popularity

Downloads/wk

5.1K

GitHub Stars

2

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

2

Size (min+gzip)

1.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

express-stylus Build Status

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-compile
  • src Source directory used to find .styl files
  • dest Destination directory used to output .css files when undefined defaults to src.
  • compress Whether the output .css files should be compressed
  • firebug Emits debug infos in the generated css that can be used by the FireStylus Firebug plugin
  • linenos Emits comments in the generated css indicating the corresponding stylus line
  • sourcemap Generates a sourcemap in sourcemaps v3 format

Extra options supported by this middleware:

  • use: An array of initialized functions
  • import: 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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial