1.0.9 • Published 8 years ago

handlebars-subexpression-helpers v1.0.9

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

handlebars-subexpression-helpers

Some simple yet useful subexpression helpers for handlebars

From the Handlebars docs:

{{outer-helper (inner-helper 'abc') 'def'}}

To make your life easier I created a set of simple and useful helpers for Handlebars which can exclusively be used as subexpression-helpers.

Usage

Node.js

npm install handlebars-subexpression-helpers

Then you just need to require the module and pass your Handlebars instance to the .register() method:

var Handlebars = require('handlebars');
require('handlebars-subexpression-helpers').register(Handlebars);

Done. Now you can use all of the included helpers.

<p>Manuel – Status: {{#if (isEqual user.status 'unconfirmed') }} Not yet activated {{else}} Active {{/if}}</p>

If you don't need all helpers you can also require single helpers. All of them export a register() method which expect your Handlebars instance to be passed:

var Handlebars = require('handlebars');
require("handlebars-subexpression-helpers/dist/lib/helpers/is-array").register(Handlebars);
require("handlebars-subexpression-helpers/dist/lib/helpers/typeof").register(Handlebars);

List of helpers

For a complete list, have a look at dist/lib/helpers.

While the filename is separated by dashes, the helper name itself is camelCase. So is-array.js can be used as isArray for example.

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago