express middleware for supplying jade templates to the client
Some express middleware for sending a bunch of jade templates to the client.
var frakt = require'jade-frakt';var app = express;appusefrakt__dirname + '/clientTemplates';// This will yield any jade templates in /clientTemplates as locals in any// request made.
So if the contents of
You would gain two locals in your express response -
'template-2' - which are your jade templates as strings.
dir- the directory to read templates from
options- optional - custom options
false- whether or not to precompile your jade templates. the upside of this is that you can use jade features like inheritance on the client side, and all of the template compilation is done first on the server.
false- if set to true, the templates will be exposed using express-expose (express expose also sets them as locals)