Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

load-helpers

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-helpers

Load template engine helpers (handlebars, lo-dash, etc) from file paths, globs, arrays or objects.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26K
decreased by-13.92%
Maintainers
1
Weekly downloads
 
Created
Source

load-helpers NPM version

Load template engine helpers (handlebars, lo-dash, etc) from file paths, globs, arrays or objects.

Install

Install with npm:
npm i load-helpers --save-dev

Usage

var loader = require('load-helpers');

API

loader

  • options {Object}: Default options for front-matter and helper naming.
var loader = require('load-helpers');

.option

Set or get an option.

  • key {String}: The name of the option.
  • value {*}: The value to assign.
  • returns: {*}
loader.option('a', true)
loader.option('a')
// => true

.load

Resolve and load helpers onto the cache.

  • returns {Object} 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;
  }
}]);

.set

Store a helper on the cache by name.

  • name {String}: Helper name
  • helper {String}: File path, glob pattern or object.
loader.set('foo', function(str) {
  return str;
})

.get

Get helper from the cache.

  • helper {String}: The name of the helper to get.
loader.get('foo')
//=> [function]

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on August 29, 2014.

Keywords

FAQs

Package last updated on 29 Aug 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc