How to use the compileFile function from jade

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

57
58
59
60
61
62
63
64
65
66
returnsfunction
A function to generate the html from an object containing locals
var jade = require('jade');

// Compile a function
var fn = jade.compileFile('path to jade file', options);

// Render the function
var html = fn(locals);
// => '<string>of jade</string>'
fork icon21
star icon24
watch icon7

15
16
17
18
19
20
21
22
23
24
exports.compileClient = function (source, options) {
  return jade.compileClientWithDependenciesTracked(source, options)
}

exports.compileFile = function (path, options) {
  const fn = jade.compileFile(path, options)
  return {
    fn,
    dependencies: fn.dependencies
  }
fork icon1
star icon0
watch icon3