A memoizer for asynchronous methods obeying node.js conventions.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE
README.markdown
index.js
package.json

README.markdown

async-memoizer

A memoizer for asynchronous methods which obeys node.js conventions (last argument is always a callback).

async-memoizer makes the memoization process external and transparent and keeps the method's asynchronous behaviour by relying on process.nextTick for memoized results.

Usage

var obj = {
  readFile(callback) {
    require('fs').readFile('path/to/file.txt', 'utf8', callback);
  }
};

require('async-memoizer').memoize(obj, 'readFile');

License

Licensed under the MIT license, Copyright 2010 Tobie Langel.