A small library to memoize functions for Node.js and web browser.
It supports limiting cache size and governing cache by the performance or frequency of function calls.
constmemoized=memoize.frequency(func,limit);constmemoize=require('./memoize.js');constfibonacci=(n)=>{if(n===0||n===1){returnn;}else{returnfibonacci(n-1)+fibonacci(n-2);}}constfib=memoize.performance(fibonacci,10);fib(20);