Skip to content
/ hbs Public
forked from pillarjs/hbs

Express view engine wrapper for Handlebars

License

Notifications You must be signed in to change notification settings

robby/hbs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hbs

Express.js view engine wrapper for handlebars.js, an extension of Mustache template language.

Why

While Handlbars.js is already a Node.js module, it cannot be used directly as an Express.js view engine. This module will fill that role until Handlebars.js adds Express.js view engine support directly.

Installation

npm install hbs

Usage

To set hbs as default view engine:

app.set("view engine", "hbs");

Examples

See test/server source code.

Issues

__get__ function is not supported within block helper functions.

Migrating to 1.0.0

  • Version number bumped to 1.0.0 to match Handlebars version.
  • Handlebars is now loaded using require and is longer embedded.
  • hbs.handlebarsPath was removed
  • registerHelper and registerPartial methods are exported.

Migrating from 0.0.3 from 0.0.2

Handlebars' block-helpers now needs to be in blockHelpers (see example above) instead of locals.

About

Express view engine wrapper for Handlebars

Resources

License

Stars

Watchers

Forks

Packages

No packages published