I want to use compiled jade templates on client side. How should I compile them to get javascript files ? https://github.com/visionmedia/jade
This question is a bit dated, but there is a method of compiling Jade templates,
var jade = require('jade');
var fn = jade.compile(jadeTemplate);
var htmlOutput = fn({
maintainer: {
name: 'Forbes Lindesay',
twitter: '@ForbesLindesay',
blog: 'forbeslindesay.co.uk'
}
})
Just got to the tutorial and search for compile, or the API under
jade.compile(source, options)
Be sure to set, compileDebug so you get the source,
Set this to false to disable debugging instrumentation (recommended in production). Set it to true to include the function source in the compiled template for better error messages (sometimes useful in development).