node package manager


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();
app.use(frakt(__dirname + '/clientTemplates'));
// This will yield any jade templates in /clientTemplates as locals in any 
// request made.  

So if the contents of ./clientTemplates/ was:


You would gain two locals in your express response - 'template-1' and 'template-2' - which are your jade templates as strings.

  • dir - the directory to read templates from
  • options - optional - custom options
  • compile - default: 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.
  • expose - default: false - if set to true, the templates will be exposed using express-expose (express expose also sets them as locals)