
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
load-helpers
Advanced tools
Load helpers with patterns, as an object, key-value pair, or module.
Install with npm:
$ npm install --save load-helpers
Install with yarn:
$ yarn add load-helpers
Create an instance of Loader with the given options.
Params
options {Object}Example
var Loader = require('load-helpers');
var loader = new Loader();
Register a helper function by name.
Params
name {String}fn {Function}options {Object}Example
loader.addHelper('foo', function() {
// do stuff
});
Register an object of helper functions.
Params
helpers {Object}options {Object}Example
loader.addHelpers({
foo: function() {},
bar: function() {},
baz: function() {}
});
Load one or more helpers from a filepath, glob pattern, object, or an array of any of those things. This method detects the type of value to be handled then calls one of the other methods to do the actual loading.
Params
helpers {Object}options {Object}returns {Object}: Returns the views from loader.helpersExample
var loader = new Loader();
console.log(loader.load(['foo/*.hbs', 'bar/*.hbs']));
console.log(loader.load({path: 'a/b/c.md'}));
console.log(loader.load('index', {path: 'a/b/c.md'}));
Customize how dynamically-added helpers are named as they're loaded.
Examples
Pass a custom renameHelper function on the ctor.
var loader = new Loader({
renameHelper: function(key) {
// simple camel-case
return key.replace(/\W(.)/g, function(_, ch) {
return ch.toUpperCase();
});
}
});
loader.load('for-own');
console.log(loader.helpers);
// { 'forOwn': [Function: forOwn] }
Or to only renamed specific helpers, you can pass the renameHelper function to any of the methods.
loader.load('for-own', {
renameHelper: function(key) {
// simple camel-case
return key.replace(/\W(.)/g, function(_, ch) {
return ch.toUpperCase();
});
}
});
console.log(loader.helpers);
// { 'forOwn': [Function: forOwn] }
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
| Commits | Contributor |
|---|---|
| 39 | jonschlinkert |
| 3 | doowb |
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.5.0, on April 20, 2017.
FAQs
Load helpers with patterns, as an object, key-value pair, or module.
The npm package load-helpers receives a total of 27,169 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.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.