node package manager


hogan-js template middleware and render function


Yet another hogan.js(moustache templates) middleware. Can render templates with partials serverside or precompile them for use on the client.

    var hoganyam = require('hoganyam');

Makes the templates available individually.

    app.use(hoganyam.provide(templatesDir, options));

Bundle all templates in directory into one js file

    app.use(hoganyam.bundle(templatesDir, options));
    hoganyam.render(file, context, options, function(err, str) {
        // do something with the rendered template string 

Use as broadway plugin for flatiron

    app.use(hoganyam.plugin, {dir: templatesDir, ext: '.html'});
    // now you can render directly to the response 
    app.render(res, 'templatename', { title: 'Hello Hogan'});

For options see source

MIT License

npm install hoganyam
npm test