node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

stylus-assert

Build Status

stylus-assert

Assertions directly in Stylus, using node's own module.

Installation

$ npm install stylus-assert

Javascript API

Obligatory connect/express example.

var connect = require('connect');
var stylus = require('stylus');
var stylusAssert = require('stylus-assert');
 
var server = connect();
 
function compile(str, path) {
  return stylus(str)
    .set('filename', path)
    .set('compress', true)
    .use(stylusAssert);
}
 
server.use(stylus.middleware({
    src: __dirname
  , compile: compile
}));