0.3.0 • Published 11 years ago
express-template v0.3.0
express-template 
View replacement for Express using Template.
Install
Install with npm:
npm i express-template --save-devRun tests
npm testUsage
// create normal express app
var express = require('express');
var app = express();
// create an instance of Template to use
var Template = require('template');
var template = new Template();
// require in express-template
var View = require('express-template')(template);
// add some global configuration
View.config({
data: ['data/*.json'],
layouts: ['views/layouts/*.hbs'],
partials: ['views/{partials, includes}/*.hbs']
});
// configure the express app so it uses View
app.set('view', View);API
View
Initialize a new View with the given name. This View class matches the interface for the View class in express so it can replace the default View engine.
name{String}options{Object}
Options:
defaultEnginethe default template engine namerootroot path for view lookup
.render
options{Object}fn{Function}
Render with the given options and callback fn(err, str).
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Brian Woodward
License
Copyright (c) 2015 Brian Woodward
Released under the MIT license
This file was generated by verb on January 14, 2015.