How to use the compileClient function from jade

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

74
75
76
77
78
79
80
81
82
83
returnsstring
A string of JavaScript representing a function
var jade = require('jade');

// Compile a function
var fn = jade.compileClient('string of jade', options);

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

10
11
12
13
14
15
16
17
18
19
   var file = path.join(__dirname, file);
   var ext = path.extname(file);
   if ('.jade' != ext) return;

   var str = fs.readFileSync(file, 'utf8');
	var fn = jade.compileClient(str, { compileClient: true, compileDebug: false });

	res.push('"'+path.basename(file, '.jade') + '": ' + fn.toString());
 })
//console.log(res)
fork icon3
star icon1
watch icon0

+ 3 other calls in file

15
16
17
18
19
20
21
22
23
24
25
26
27
28




exports.generate = function(file, opts) {
  var namespace = path.parse(file.path).name;


  var contents  = jade.compileClient(
    file.contents.toString(),


    {
      filename     : file.path,
fork icon2
star icon1
watch icon0

+ 3 other calls in file