{%= description %}
{%= include("install-npm", {save: true}) %}
Examples
{%%= year() %}
//=> {%= year() %}
{%%= year("YYYY") %}
//=> {%= year("YYYY") %}
{%%= year("YY") %}
//=> {%= year("YY") %}
npm test
{% var nickname = strip(name, "helper-") %}
This should work with any engine, here are a few examples
Register the helper for use with any template engine
template.helper('{%= nickname %}', require('{%= name %}'));
To register the helper for use with assemble v0.6.x:
assemble.helper('{%= nickname %}', require('{%= name %}'));
Register the helper for use with verb:
var verb = require('verb');
verb.helper('{%= nickname %}', require('{%= name %}'));
verb.task('default', function() {
verb.src('.verb*.md')
.pipe(verb.dest('./'));
});
var handlebars = require('handlebars');
handlebars.registerHelper('{%= nickname %}', require('{%= name %}'));
// as a mixin
_.mixin({{%= nickname %}: require('{%= name %}')});
_.template('<%= _.{%= nickname %}() %>', {});
//=> {%= year() %}
// passed on the context
_.template('<%= {%= nickname %}() %>', {{%= nickname %}: require('{%= name %}')});
//=> {%= year() %}
// as an import
var settings = {imports: {{%= nickname %}: require('{%= name %}')}};
_.template('<%= {%= nickname %}() %>', {}, settings);
//=> {%= year() %}
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})
To request or contribute a helper to the github.com/helpers org, please read this contributing guide to get started.
{%= include("author") %}
{%= copyright() %} {%= license() %}
{%= include("footer") %}