0.1.0 • Published 6 years ago

mgmco-hbs-helpers v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

MGMCo Handlebars helpers Build Status

Some useful helpers to be used with any Handlebars environment.

What's actually here

This repo contains a few helper functions intended to be initialised as Handlebar helpers. This should be done inside your own HBS instance, and is out of scope for this library. You can do this like so:

// Assumes you have an instance of Handlebars
Handlebars.registerHelper('helperName', helperFunction)

More detailed usage docs are in each of the helper's files in the helpers folder.

  • formatCurrency(amount, options)
  • math(operand1, operator, operand2)
  • concat(fragment1, [fragment2, fragment3 ...])
  • isEqual(value1, value2)
  • or(value1, [value2 ...])
  • not(value)
  • and(value1, value2)

ES6+

These are written in ES6+ Javascript. You should really transpile these, but again, you should be doing this in your own build pipeline.