How to use the compileFileClient function from jade
Find comprehensive JavaScript jade.compileFileClient code examples handpicked from public code repositorys.
GitHub: zhoutony/html5
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).
21
24
7
jade.compile is the most popular function in jade (34 examples)