jadist
v0.2.3
Published
an express view engine that delegates jade and caches the compile view functions.
Downloads
1
Readme
Jadist
An express view engine that proxies Jade to allow for pre-compilation of Jade templates to a single JavaScript file for production.
Getting Started
Install Jadist:
npm install jadist --save
Examples
Jadist was written to improve the render performance of Jade templates in Express apps written in CoffeeScript. As such, the examples will demonstrate its usage in this context. However, Jadist's API should translate well to pure JavaScript.
Precompile the Views
If you use Grunt for your build you may want to look into Grunt-Jadist for this step.
# use jadist to precompile the views users.jade, accounts.jade, admins.jade
jadist = require 'jadist'
jadist.compile 'dest/views.js', 'views', 'views/users.jade', 'views/accounts.jade', 'views/admins.jade'
Configure The Middleware
#...
app.configure 'production', ->
# use jadist to serve jade views that have been precompiled into views.js
app.engine 'jade', require('jadist').engine app, require('./views')
#...
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
Release History
(Nothing yet)