Provides helpers and methods to filter content
var Handlebars = require("handlebars");
var Filter = require("handlebars.filter");
Filter.registerHelper(Handlebars);
Returns
Filter instance
- Type
- object
Methods
(static) locale(locopt) → {string}
Get or set default locale used by Filter
If called without loc parameter, returns locale
If called with loc parameter, sets locale
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
loc |
string |
<optional> |
Locale to switch to |
Returns
Filter’s locale
- Type
- string
(static) registerFilter(name, fn)
Add filter to Filter
Parameters
Name | Type | Description |
---|---|---|
name |
string | Name of filter |
fn |
function | Filter function |
(static) registerHelper(hbars)
Register Filter helper with Handlebars
Parameters
Name | Type | Description |
---|---|---|
hbars |
object | [description] |
(static) unregisterFilter(name)
Remove filter from Filter
Parameters
Name | Type | Description |
---|---|---|
name |
string | Name of filter |