
Load template engine helpers (handlebars, lo-dash, etc) from file paths, globs, arrays or objects.
npm i helper-loader --save-dev
var Loader = require('helper-loader');
var helpers = new Loader();
Create a new instance of Loader, optionally passing default options.
options {Object}: Default options for front-matter and helper naming.Example:
var Loader = require('helper-loader');
var helpers = new Loader();
Set or get an option.
key {String}: The name of the option.value {*}: The value to assign.loader.option('a', true)
loader.option('a')
// => true
Resolve and load helpers onto the cache.
loader// require a helper
loader.load(require('foo'));
// Pass a string or array of file paths or glob patterns
loader.load('a.js');
loader.load(['a.js', 'b.js', 'c.js']);
loader.load(['*.js']);
// pass an object
loader.load({
a: function (str) {
return str;
}
});
// pass an array of objects
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')
//=> [function]
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license
This file was generated by verb-cli on August 13, 2014.