How to use the compileFileClient function from pug
Find comprehensive JavaScript pug.compileFileClient code examples handpicked from public code repositorys.
GitHub: pugjs/pug-en
197 198 199 200 201 202 203 204 205 206
```js var fs = require('fs'); var pug = require('pug'); // Compile the template to a function string var jsFunctionString = pug.compileFileClient('/path/to/pugFile.pug', {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); ```
31
12
7
+ 3 other calls in file
pug.compileFile is the most popular function in pug (496 examples)