Async Function Memoizer

npm install memoize-async
1 downloads in the last day
10 downloads in the last week
20 downloads in the last month

memoize-async Build Status

Async function memoizer.


$ npm install memoize-async


memoize  = require('memoize-async')
readFile = require('fs').readFile
memoized = memoize(readFile)

memoized('docs/readme', console.log)
// doing some work
// => read me first!

memoized('docs/readme', console.log)
// => read me first!


It stores the values returned in an object by default. You can pass read & write methods to choose your own:

memoized = memoize(fn, { read: read, write: write, hash: ifexists })

function read (key, callback) {

function write (key, value, callback) {
npm loves you