Billy Moon
Billy Moon

Reputation: 58521

what is wrong with my jade?

contents of: file.js

var jade;

jade = require('jade');

console.log(jade.render("!!! 5"));

on the shell:

$ node file.js

produces this error:

~/Documents/projects/mine/nodetest/jade.js:207
  if (options.cache && !options.filename) {
             ^

I am using the latest download of jade, installed via:

$ npm install jade

in the root of my project.

Upvotes: 0

Views: 72

Answers (1)

Jonathan Lonowski
Jonathan Lonowski

Reputation: 123423

jade.render expects a callback after the template string, which will be passed the results:

jade.render('!!! 5', function (err, html) {
    console.log(html); // <!DOCTYPE html>
});

Source.

Upvotes: 2

Related Questions