jack e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
..
test e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
.jshintrc e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
.npmignore e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
.testem.json e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
.travis.yml e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
LICENCE e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
README.md e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
index.js e1a2621c78 update %!s(int64=2) %!d(string=hai) anos
package.json e1a2621c78 update %!s(int64=2) %!d(string=hai) anos

README.md

continuable-cache

Cache a continuable

Example

var cache = require("continuable-cache")
var fs = require("fs")

var readFile = function (uri) { return function (cb) {
    fs.readFile(uri, cb)
} }

var continuableFile = readFile("./package.json")

var cached = cache(continuableFile)

// will only do one file read operation
cached(function (err, file) {
    /* calls out to fs.readFile */
})

cached(function (err, file) {
    /* get's either err or file from cache in cached */
})

Installation

npm install continuable-cache

Contributors

  • Raynos

MIT Licenced