1.1.9 • Published 6 years ago

kingsquare-handlebars-helpers v1.1.9

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

Kingsquare handlebars 2.0 helpers

Install using npm: npm install kingsquare-handlebars-helpers --save

Usage

var handlebars = require('handlebars');
var helpers = require('kingsquare-handlebars-helpers');

Object.keys(helpers).forEach(function (helperName) {
	handlebars.registerHelper(helperName, helpers[helperName]);
});

Helpers

BlockDescriptionParams
comparecompares a value by operation eq, eqeq, neq, neqeq , lt , gt , lte, gte, typeof, regexp, mod.value, operation, expected
concatconcats valuesa, b
csvEscapeEscape value for use in CSVvalue
dateFormat
filterFilter object by given operation on key using valueobject, key , operation, value
fromContainer
host
nl2brTranslate line breaks to html breaksvalue
priceMake a number a human readable price (with possible currency)value, currencySymbol (optional)
untilDateFormat
urlencodeURL encodes the given valuevalue

Compare

Compares a value by operation eq, eqeq, neq, neqeq , lt , gt , lte, gte, typeof, regexp, mod.

Parameters:

value, operation, expected

Examples:

{#compare this "eq" "that"}
    Hello
{/compare}

Inversion support

{#compare this "eq" "that"}
    Hello
{else}
    Goodbye
{/compare}

Price

Make a number a human readable price (with possible currency)

Parameters:

value, currencySymbol

Examples:

{price this}

{price this "€"}

urlencode

URL encodes the given value

Parameters:

value

Examples:

{urlencode this}
1.1.9

6 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago