Utils Helpers

Handlebars provides a set of built-in helpers for working with utility functions. These helpers are used to manipulate and format data, making it easier to work with complex data structures in templates.

The following utils are exposed on .utils.

Visit the: code

Table of Contents

{{changecase}}

Change casing on the given string, optionally passing a delimiter to use between words in the returned string.

Params

  • string {String}: The string to change.
  • returns {String}

Example

utils.changecase('fooBarBaz');
//=> 'foo bar baz'

utils.changecase('fooBarBaz' '-');
//=> 'foo-bar-baz'

{{random}}

Generate a random number

Params

  • min {Number}
  • max {Number}
  • returns {Number}