express-hbs-helpers

Handlebars helpers for Express 3

Handlebars helpers for Express 3

View helpers for handlebars engine. Work well with Express 3.

var engine = require('express-hbs');
var express = require('express');
 
var app = express();
 
app.configure(function() {
  app.engine('hbs', engine.express3);
 
  app.set('view engine', 'hbs');
  app.set('helpers', engine.handlebars.helpers);
});
 
var helpers = require('express-hbs-helpers').helpers;
helpers(app, engine);
engine = require 'express-hbs'
express = require 'express'
 
app = express()
 
app.configure ->
  app.engine 'hbs'engine.express3
 
  app.set 'view engine''hbs'
  app.set 'helpers'engine.handlebars.helpers
 
{helpers} = require 'express-hbs-helpers'
helpers appengine

  • helper_date
  • helper_datetime
  • helper_year
  • helper_plural
  • helper_striptags
  • helper_htmlescape
  • helper_urlencode
  • helper_money
  • helper_length
  • helper_wrap

Options:

helper_date (date, options)

  • humane boolean default: false
  • html boolean default: false

helper_datetime (date, options)

  • humane boolean default: false
  • html boolean default: false

helper_plural (count, options)

  • words array

helper_wrap (text, options)

  • size number default: 40