Skip to content
Hogan.js for Express with support for Template Partials.
Branch: master
Clone or download
Quang Van
Quang Van Update
unmaintained message.
Latest commit 5029ccc Jun 16, 2016

Project is no longer being maintained.


Connect Hogan.js with Express, with support for Partials.

Hi {{name}}

{{> salute}}

Why is Hogan.js Awesome?

Logic-less templates, keeping control separate from views. Views separated from content.

Doesn't have many bells and whistles. HTML Structure, and views are suppose to be simple.

Mustache is awesome. Has many implementations. It's clear what's a {{variable}} and what is not.

Why Hulk-Hogan?

Becaues he's awesome. But also because there wasn't a solution I could find that let's you easily use Mustaches' partials natively with Express.

Partials Example


  {{> header}}
  My body.
  {{> footer}}


<h1>Hey There</h1>


<footer>See ya</footer>


  <h1>Hey There</h1>
  My body.
  <footer>See ya</footer>

Sub-Partials supported

You can link partials from within other partials.





Usage Example


Hello {{what}}!


  express = require 'express'
  hulk = require 'hulk-hogan'

  app = express.createServer()

  app.set 'views', __dirname+'/views'  # Directory of your views
  app.set 'view options', layout:false
  app.set 'view engine', 'hulk'  # use the .hulk file extensions for your views
  app.register '.hulk', hulk  # register to render .hulk with Hulk-Hogan

  app.get '/', (req,res)->
    res.render 'index', {what:'World'}

  app.listen 3000

coffee http://localhost:3000 would produce:

Hello World!



 var app, express, hulk;

 express = require('express');
 hulk = require('hulk-hogan');

 app = express.createServer();

 app.set('views', __dirname + '/views');
 app.set('view options', {layout: false});
 app.set('view engine', 'hulk');
 app.register('.hulk', hulk);

 app.get('/', function(req, res) {
   res.render('index', {
     what: 'World'


node app.js http://localhost:3000 would produce:

Hello World!

Automated Tests

Hulk-Hogan uses mocha & mocha-cakes for testing.

make buffet should run all tests.


Hulk-Hogan inspired by HBS

should checkout express-hogan.js

and Micah Smith's hogan-express.js blog post for reference.

Special Thanks to the Hogan.js Twitter Team, as well as Hulk-Hogan's grand-dad, (or is it more like Great Uncle?) Mustache.

Also Thanks to TJ for the excellent Express and Express-Resource.

You can’t perform that action at this time.