npm package to memoize class instance methods