Answer the question
In order to leave comments, you need to log in
How to understand api jade?
Good afternoon!
I can’t figure out api jade, I look at the doc and all the examples are too meager for simpler examples.
In general, I want to write a template on node, into which several variables will be inserted (compiled on the server side) and given to the browser.
And if you have a good article on jade api in mind, I will also be grateful if you drop it :)
Answer the question
In order to leave comments, you need to log in
So here it is, much easier:
var jade = require('jade');
// Compile a function
var fn = jade.compileFile('path to jade file', options);
// Render the function
var html = fn(locals);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question