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

helper-cache

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

helper-cache

Easily get and set helper functions to pass to any application or template engine.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
increased by17.52%
Maintainers
1
Weekly downloads
 
Created
Source

helper-cache NPM version

Easily get and set helper functions to pass to any application or template engine.

Install

Install with npm:
npm i helper-cache --save-dev

Usage

var Cache = require('helper-cache');

var helpers = new Cache();
helpers.set('a', function (str) {
  return str.toLowerCase();
});
helpers.set('b', function (str) {
  return str.toUpperCase();
});

console.log(helpers)
//=> { options: { bindFunctions: false },
//    '.a': [Function],
//    '.b': [Function] }

var mixins = new Cache();
mixins.set('a', function (str) {
  return str.toLowerCase();
});
mixins.set('b', function (str) {
  return str.toUpperCase();
});

console.log(mixins);
//=> { options: { bindFunctions: false },
//    '.a': [Function],
//    '.b': [Function] }

API

Helpers

  • options {Object}: Default options to use.
    • bindFunctions {Boolean}: Bind functions to this. Defaults to false.
var Helpers = require('helper-cache');
var helpers = new Helpers();

.set

  • key {String}: The name of the helper.
  • fn {Function}: Helper function.

Set helpers on the cache.

.get

  • key {String}: The helper to get.
  • returns {Object}: The specified helper. If no key is passed, the entire cache is returned.

Get a helper from the cache.

Author

Jon Schlinkert

License

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


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

Keywords

FAQs

Package last updated on 28 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