How to use the compileFileClient function from pug

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

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);
```
fork icon31
star icon12
watch icon7

+ 3 other calls in file