Socket
Book a DemoInstallSign in
Socket

a-cachify

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-cachify

Easily add a cache layer to any function.

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

a-cachify

NPM Version LICENSE Build Status dependencies Status devDependencies Status

Easily add a cache layer to any function.

Installation

npm install a-cachify

Usages

const {cachify, join} = require('a-cachify');
const Cache = require('cache-module');
const cache = new Cache();

let doSomething = function (arg1, arg2) {
  result = heavyWork(arg1, arg2);
  return result;
}

// Add a cache layer
doSomething = cachify(cache, doSomething, join);

doSomething(1, 2);
doSomething(1, 2); // return the cached result

API

cachify (cache, fn [ , keyMaker ] [ , thisArg ])

add a cache layer to the function.

apply (cache)

wrap (cache)

join

joinN

License

Copyright (c) 2019 dailyrandomphoto. Licensed under the MIT license.

Keywords

cache

FAQs

Package last updated on 14 Jan 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.