To get all helpers:
const helpers = require('{%= name %}')();
console.log(helpers);
Get a specific helper category
// get only the math helpers
const helpers = require('{%= name %}')('math');
Get multiple helper categories
// get only the math helpers
const helpers = require('{%= name %}')(['math', 'string']);
Lo-Dash Example
const helpers = require('{%= name %}')('array');
// pass helpers on `imports`
const imports = { imports: helpers };
// compile a template
const fn = _.template('<%= first(foo) %>', imports);
// render
fn({ foo: ['a', 'b', 'c'] });
//=> 'a'
Handlebars and Lo-Dash both allow dot notation to be used for referencing helpers. I'd be happy to add examples for other engines if someone wants to do a PR.
Example
<%= path.dirname("a/b/c/d.js") %>
This can be used as a way of working around potential naming conflicts.
(The following API Table of Contents is generated by [verb][]. See the verbfile.js for more details.)
{%= include("docs/toc.md") %}
{%= increaseHeadings(apidocs("lib/helpers/array.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/code.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/collection.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/conditional.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/fs.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/html.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/index.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/math.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/object.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/path.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/string.js")) %}
{%= coverage("coverage/summary.txt") %}