Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
func-cache
Advanced tools
This is the fun and cache.
It stores a map of results of a function and uses arguments as keys, for faster response,
Note that if the function result in different results with the same argument, the cache wouldn't work.
import funcache from "func-cache";
const cachedFibonacci: typeof fibonnacci = funcache(fibonacci);
function fibonnacci(num: number) {
let a = 1,
b = 0,
temp;
while (num >= 0) {
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
FAQs
TypeScript library for caching static functions
The npm package func-cache receives a total of 20 weekly downloads. As such, func-cache popularity was classified as not popular.
We found that func-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.