pejs template rendering for root

npm install response.render
7 downloads in the last week
28 downloads in the last month


response.render is a small plugin for root that adds a render function to the response

npm install response.render

response.render will render a PEJS template and write it to the response while adding the appropriate headers.

var root = require('root');

var app = root();

app.use(require('response.render'), {
    helpers: require('./my-template-helpers')      // set global locals (like some helpers)

app.all(function(request, response, next) {
    response.locals.user = {username:'test-user'}; // set default locals

app.get(function(request, response) {
    response.render('./my-test-template', {my:'locals'});

npm loves you