jade.compile returning a function

I want to redo my blog but my code below seems to be returning [function] whenever I console.log it. Yes it is the correct path, and it used to work before I updated jade but not anymore.

post.stub = jade.compile(
        fs.readFileSync(__dirname + '/blog/' + p + '/stub.jade')
)

How do I fix this so that console.log(post.stub) will return my :markdown present in the jade file instead of [function] ?

Thanks in advance.

Updated answer:

 post.stub = jade.compile(
            fs.readFileSync(__dirname + '/blog/' + p + '/stub.jade')
        )({})

This is how jade and all similar template systems work. There are 2 steps:

  1. Convert a jade text template into a function (only needs to happen once per template)
  2. Take a set of context data, run it through the compiled template function, and return the rendered string as HTML (happens every time you have unique context data)

So if your template doesn't need any context data, just invoke it with an empty object (probably null/undefined would also work fine):

post.stub = jade.compile(
        fs.readFileSync(__dirname + '/blog/' + p + '/stub.jade')
)({})

See also the jade javascript API docs.