NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3424 most downloaded on npm
Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 9 days to 1.8 years
Most releases are documented
notes for 16 of 24 stable releases
1 version withdrawn
withdrawn after publishing
11 years old
29 releases · first in 2015
Rename package from mem to memoize 4756892
mem to memoize 4756892memDecorator named import to memoizeDecorator 4756892memClear named import to memoizeClear 4756892https://github.com/sindresorhus/mem/compare/v9.0.2...v10.0.0
Export missing Options type (#88) 9a937d0
Options type (#88) 9a937d0https://github.com/sindresorhus/mem/compare/v9.0.1...v9.0.2
One column per quarter.
Fix using multiple decorators on the same instance (#78) 7f7ca0a
https://github.com/sindresorhus/mem/compare/v9.0.0...v9.0.1
Require Node.js 12.20 (#76) 32c01b1
https://github.com/sindresorhus/mem/compare/v8.1.1...v9.0.0
Don't use the same memoized function across instances when .decorator() is used (#75) d21357c
.decorator() is used (#75) d21357chttps://github.com/sindresorhus/mem/compare/v8.1.0...v8.1.1
Add `.decorator()` method for TypeScript users (#61) 528fa42
.decorator() method for TypeScript users (#61) 528fa42https://github.com/sindresorhus/mem/compare/v8.0.0...v8.1.0
Convert the package to TypeScript (#64) 0b5c364 The types might be slightly different than v6.
.clear(fn) if fn’s cache can't be cleared (#59) e7c8893https://github.com/sindresorhus/mem/compare/v6.1.1...v8.0.0
What happened to v7? This version was prematurely published as v7, so we did v8 to prevent breaking for those already on v7.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Slightly improve performance (#57) ea88c5c
https://github.com/sindresorhus/mem/compare/v6.1.0...v6.1.1
Automatically use WeakMap when possible (#56) e8bb86c
https://github.com/sindresorhus/mem/compare/v6.0.1...v6.1.0
Support overloaded functions (TypeScript types) (#48) 809697d009059bf177c0d556009eaee121dc2ef6
Simplify the default cacheKey (#43) b7a0766 It now defaults to cacheKey: x => x instead of the much more complicated previous default. This means it w
cacheKey (#43) b7a0766
It now defaults to cacheKey: x => x instead of the much more complicated previous default. This means it will now only cache the first argument, and only if it's a primitive. Previously, it tried to cache all arguments using JSON.stringify(), but this was both error-prone and slow. This change makes the memoization logic very straightforward, explicit and fast by default. See the readme for how to handle multi-argument or non-primitive value situations.cachePromiseRejection option (#43) b7a0766
It was not a good fit for mem and we plan to add it to p-memoize instead (https://github.com/sindresorhus/p-memoize/issues/11), which is like mem, but focused on promises..clear() is called with a non-memoized function (#44) c73c23bhttps://github.com/sindresorhus/mem/compare/v5.1.1...v6.0.0
Always use an object for the cache item to match expectations and the TypeScript definitions (#42) 1f38c3e
https://github.com/sindresorhus/mem/compare/v5.1.0...v5.1.1
Minor performance optimization (#39) c098182
Enhancements:
https://github.com/sindresorhus/mem/compare/v5.0.0...v5.1.0
Change the default value of the cachePromiseRejection option to true (#36) 70707ae *We decided it's better to default to the least surprising/magic be
Breaking:
cachePromiseRejection option to true (#36) 70707ae
We decided it's better to default to the least surprising/magic behavior.Breaking for TypeScript users:
import mem from 'mem'; to import mem = require('mem');Enhancements:
https://github.com/sindresorhus/mem/compare/v4.3.0...v5.0.0
Refactor TypeScript definition to use CJS compatible export (#32) 9a432b9
https://github.com/sindresorhus/mem/compare/v4.2.0...v4.3.0
Add TypeScript definition (#28) 6887496
https://github.com/sindresorhus/mem/compare/v4.1.0...v4.2.0
Work around some host environments throwing on mimicFn call (#26) e08ad85
mimicFn call (#26) e08ad85https://github.com/sindresorhus/mem/compare/v4.0.0...v4.1.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →