package
Map that keeps track of the hits and misses
npm install stats-mapGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
$ npm install --save stats-mapconst StatsMap = require('./');
const mem = require('mem');
let i = 0;
const counter = () => ++i;
const cache = new StatsMap();
const memoized = mem(counter, {cache});
memoized('foo');
//=> 1
// cached as it's the same argument
memoized('foo');
//=> 1
// not cached anymore as the argument changed
memoized('bar');
Inherits from Map.
Type: object
The statistics of the map like the hits and misses.
MIT © Sam Verschueren