Package Exports
- load-helpers
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (load-helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
load-helpers 
The most interesting project in the world > Verb
Install
Install with npm
$ npm i load-helpers --save
Usage
var loader = require('load-helpers');
// optionally pass an object to use for caching the helpers
var cache = {};
var helpers = loader(cache);
// object of helpers
helpers({
a: function(),
b: function(),
c: function()
});
// key-value pairs
helpers('d', function() {});
helpers('e', function() {});
helpers('f', function() {});
// glob pattern or file path, string or array
helpers('helpers/*.js'); // g, h, i
// required from node_modules
helpers('j');
Results in:
{
a: function(){},
b: function(){},
c: function(){},
d: function(){},
e: function(){},
f: function(){},
g: function(){},
h: function(){},
i: function(){},
j: function(){}
}
options.renameKey
When requiring helpers from a filepath or node_modules
a renameKey
function may be passed on the helper's options to customize how the key is named:
Example
helpers('for-own', {
renameKey: function (key) {
// naive camelize
return key.replace(/\W(.)/g, function (_, ch) {
return ch.toUpperCase();
});
}
});
//=> {forOwn: [function]}
Related projects
- handlebars-helpers: 120+ Handlebars helpers in ~20 categories, for Assemble, YUI, Ghost or any Handlebars project. Includes… more | homepage
- helper-cache: Easily register and get helper functions to be passed to any template engine or node.js… more | homepage
- template-helpers: Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… more | homepage
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on September 11, 2015.