Collection of helpers for Handlebars
- Internationalisation - handlebars.phrase
- Inflection/pluralisation - handlebars.choice
- Content filtering - handlebars.filter
- HTML element generation - handlebars.el
- Form generation - handlebars.el.form
- Dates and time - handlebars.moment
- Numbers - handlebars.numeral
Version
1.0.1
Installation
npm install larynx
Registering the helpers
var Handlebars = require("handlebars");
var Larynx = require("larynx");
Larynx.registerHelpers(Handlebars);
Setting locales and languages
Larynx.locale(loc);
Larynx.setLanguages(langs);
Helpers provided
- phrase
- choose
- choice
- filter
- el
- el-checkbox
- el-field
- el-fieldset
- el-file
- el-form
- el-hidden
- el-label
- el-message
- el-password
- el-radio
- el-select
- el-submit
- el-text
- el-textarea
- moment
- duration
- byte
- currency
- number
- numeral
- ordinal
Convenience methods
locale
Set Larynx’s locale
Larynx.locale(loc);
See larynx.locale
registerFilter
Add a content filter
Larynx.registerFilter(name, fn);
setLanguages
Larynx.setLanguages(langs, options);
addLanguages
Larynx.addLanguages(langs);
setLanguage
Larynx.setLanguage(lang, phrases);
addLanguage
Larynx.addLanguage(lang, phrases);
Tests
npm test
To see output generated by tests
npm run test:output