How to use the compileFileClient function from jade

Find comprehensive JavaScript jade.compileFileClient code examples handpicked from public code repositorys.

109
110
111
112
113
114
115
116
117
118

var fs   = require('fs');
var jade = require('jade');

// Compile the template to a function string
var jsFunctionString = jade.compileFileClient('/path/to/jadeFile.jade', {name: "fancyTemplateFun"});

// Maybe you want to compile all of your templates to a templates.js file and serve it to the client
fs.writeFileSync("templates.js", jsFunctionString);
Here's what the output function string looks like (written to templates.js).
fork icon21
star icon24
watch icon7