
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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 25,741 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.