hoganyam

0.1.0 • Public • Published

hoganyam

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

Usage

    var hoganyam = require('hoganyam');

As connect-style middleware

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

Serverside rendering

    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

License

MIT License

Install with npm

npm install hoganyam

Run tests

npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    2
  • 0.0.3
    2
  • 0.0.2
    2
  • 0.0.1
    2
  • 0.0.0
    2

Package Sidebar

Install

npm i hoganyam

Weekly Downloads

5

Version

0.1.0

License

none

Last publish

Collaborators

  • skoni