Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Express middleware for ember handlebars
JavaScript
tag: 0.0.3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
LICENSE
README.md
package.json

README.md

Introduction

connect-handlebars is Connect middleware that pre-compiles handlebars to JS. Since express is built on top of Connect, connect-handlebars will allow you to compile handlebars templates with expressjs.

Installation

npm install connect-handlebars

Usage

Example in express:

var connect_handlebars = require('connect-handlebars')
app = require('express').createServer()

app.use("/templates.js", connect_handlebars("path/to/handles/templates", {
  exts: ['hbs','handlebars']
}));

app.listen(80);

The middleware builder takes two arguments source and options

  • source: The path to the root directory of .handlebars files to compile.
  • options: Object of options with the following keys
    • exts: String|Array of file extensions to pre-compille. e.g. 'handlebars or ['handlebars','hbs']
Something went wrong with that request. Please try again.