express-jade-cache-helper

1.0.4 • Public • Published

express-jade-cache-helper

npm version Build Status codecov.io

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')

Options

Use DEBUG=ejch:cache to debug with debug.

Package Sidebar

Install

npm i express-jade-cache-helper

Weekly Downloads

1

Version

1.0.4

License

MIT

Last publish

Collaborators

  • antpaw