Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
load-helpers
Advanced tools
Load helpers with patterns, as an object, key-value pair, or module.
Install with npm:
$ npm install --save load-helpers
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(){}
}
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]}
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on July 23, 2016.
FAQs
Load helpers with patterns, as an object, key-value pair, or module.
The npm package load-helpers receives a total of 20,241 weekly downloads. As such, load-helpers popularity was classified as popular.
We found that load-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.