jade-runtime

The runtime components for the jade templating language

jade-runtime

The runtime components for the jade templating language

npm install jade-runtime

You can call runtime methods directly using runtime.method. This is particularly useful when compiling to deal with things that are already known at compile time.

var runtime = require('jade-runtime');
 
assert(runtime.attr('foo', bar', true, true) === ' foo="bar"');

You can also build a string with a given list of functions available as jade_method by calling build(...methods). This is useful for inlining runtime functions within the compiled templates.

var build = require('jade-runtime/build');
var src = build(['attr']);
 
var attr = Function('', src + ';return jade_attr;')();
assert(attr('foo', bar', true, true) === ' foo="bar"');

MIT