This package provides a set of powerful and convenient Handlebars helpers to enhance your templating experience. It simplifies common tasks and adds useful functionalities to your Handlebars templates.
npm install handlebars-extdThis package provides a set of powerful and convenient Handlebars helpers to enhance your templating experience.
It simplifies common tasks and adds useful functionalities to your Handlebars templates.
bash
npm install --save handlebars-extd
`Release Notes
All changes can be found here.- [1.0.13] - 2025/2/4
- Fixed a typo in the stripTags sample code.
- [1.0.12] - 2025/2/4
- Added a helper to replace HTML tags in a string. See the stripTags documentation for more details.
Example:
`js
// results in: lorem ipsum dolor sit amet
hbs.compile("{{{stripTags html}}}")({
html: 'lorem ipsum dolor sit amet',
});
// results in: lorem ipsum dolor sit amet
hbs.compile("{{{stripTags html allowedTags}}}")({
html: 'lorem ipsum dolor sit amet',
allowedTags: ['strong'],
});
// results in: 🍩lorem ipsum 🍩dolor🍩 🍩sit🍩 amet🍩
hbs.compile("{{{stripTags html allowedTags replacement}}}")({
html: 'lorem ipsum dolor sit amet',
allowedTags: [],
replacement: '🍩',
});
`
- [1.0.11] - 2025/1/14
- findObjectInArray Handlebars helper: This helper allows you to find an object in an array based on a specified field name and value.
`js
// results in: "Item A"
const items = [{id: 123, name: 'Item A'}, {id: 456, name: 'Item B'}];
hbs.compile(
{{#each items}})({items});
- [1.0.10] - 2024/7/31
- Fix TypeError: Cannot read properties of undefined (reading 'Symbol') error in executing each function on an object.Testing
With npm do:`bash
npm test
``* github/takuya-motoshima
* twitter/TakuyaMotoshima
* facebook/takuya.motoshima.7