1.0.12 • Published 1 year ago

js-function-cache v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Javacript Function Cache

A simple but powerful (ig) npm package for caching the results of function calls, reducing the number of times the function needs to be executed. https://github.com/therealrinku/js-function-cache

Usage

import jsFunctionCache from "js-function-cache";

function expensiveFunction(a, b) {
  return a + b;
}

//keyName must be unique
const keyName = "jptKey"
const cachedFunction = () => jsFunctionCache(keyName, () => expensiveFunction(2, 4));

cachedFunction(); // executes the function and caches the result
cachedFunction(); // returns cached result

Contributing

Pull requests are welcomed with open heart here https://github.com/therealrinku/js-function-cache

License

The package is available as open source under the terms of the ISC License.

Special Thanks

Special thanks to ChatGPT for helping me generate this readme.md file cause I suck at writing markdown files fr no cap.

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago