load-helpers
Load template engine helpers (handlebars, lo-dash, etc) from file paths, globs, arrays or objects.
Install
Install with npm:
npm i load-helpers --save-dev
Usage
var loader = require('load-helpers');
API
options
{Object}: Default options for front-matter and helper naming.
var loader = require('load-helpers');
Set or get an option.
key
{String}: The name of the option.value
{*}: The value to assign.returns
: {*}
loader.option('a', true)
loader.option('a')
Resolve and load helpers onto the cache.
loader.load(require('foo'));
loader.load('a.js');
loader.load(['a.js', 'b.js', 'c.js']);
loader.load(['*.js']);
loader.load({
a: function (str) {
return str;
}
});
helper.load([{
a: function (str) {
return str;
},
b: function (str) {
return str;
}
}]);
Store a helper
on the cache by name
.
name
{String}: Helper namehelper
{String}: File path, glob pattern or object.
loader.set('foo', function(str) {
return str;
})
Get helper
from the cache.
helper
{String}: The name of the helper to get.
loader.get('foo')
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on August 29, 2014.