https://github.com/medikoo/memoize
npm install memoizee For one of my projects I needed memoizer, that would be both fast and would work with any type of input arguments. Other projects demanded other common functionalities, so it's result of real world needs I approached in last months. To make it complete in latest stage I added max and maxAge options (lru-cache inspiration) Features in short: - Works with any type of function arguments – no serialization is needed - Works with any length of function arguments. Length can be set as fixed or dynamic. - One of the fastest available solutions (when talking about plain simple case it's slightly slower than basic underscore implementation and about 3 x faster than lru-cache) - Support for asynchronous functions - Optional primitive mode which assures fast performance when arguments are conversible to strings. - Can be configured for methods (when `this` counts in) - Cache can be cleared manually or after specified timeout - Cache size can be limited - Optionally accepts resolvers that normalize function arguments before passing them to underlying function. - Optional reference counter mode, that allows more sophisticated cache management - Profile tool that provides valuable usage statistics - Covered by over 500 unit tests I use it all over the place now. Let me know what you think, any feedback highly welcome -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
