cimpress-handlebars-helpers

0.0.5 • Public • Published

A set of simple handlebars helpers

Included helpers

Usage

flatMap

import {flatMapHelper} from 'cimpress-handlebars-helpers';
handlebars.registerHelper("flatMap", flatMapHelper);
Params
  • array - an array to iterate over
  • path - a path that identifies the element to take
Example
{{flatMap array "itemId"}}

filterByValues

import {filterByValuesHelper} from 'cimpress-handlebars-helpers';
handlebars.registerHelper("filterByValues", filterByValuesHelper);
Params
  • collection - an array to iterate over
  • element - element to use for filtering
  • values - filter the array based on these values
Example
{{filterByValues items 'itemId' [ '1', '2', '3' ] }}

Package Sidebar

Install

npm i cimpress-handlebars-helpers

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

5.2 kB

Total Files

7

Last publish

Collaborators

  • trdelnik_squad