express-jade-cache-helper
v1.0.4
Published
express helper that caches all .jade files to memory on startup
Downloads
3
Maintainers
Readme
express-jade-cache-helper
express helper that caches all .jade files to memory on startup
Install
$ npm install --save express-jade-cache-helper
Usage
Below is a example of usage.
var express = require('express');
var jadeCacheHelper = require('express-jade-cache-helper');
var app = express();
var indexApp = express();
indexApp.set('view engine', 'jade');
indexApp.set('views', __dirname + '/templates');
indexApp.get('/home', function(req, res, next){
res.render('show');
});
app.use(jadeCacheHelper(adminApp)); // <= important part
app.listen(3000);
API
jadeCacheHelper(expressApp, options)
:
- expressApp: express app, important: it needs to fire
'mount'
event - options:
- jadeExt: Template file name extension (default
'.jade'
)
- jadeExt: Template file name extension (default
Options
Use DEBUG=ejch:cache
to debug with debug.