Kevin 29b9a0c50c clean && clean html base 4 years ago
..
test 29b9a0c50c clean && clean html base 4 years ago
.jshintrc 29b9a0c50c clean && clean html base 4 years ago
.npmignore 29b9a0c50c clean && clean html base 4 years ago
.testem.json 29b9a0c50c clean && clean html base 4 years ago
.travis.yml 29b9a0c50c clean && clean html base 4 years ago
LICENCE 29b9a0c50c clean && clean html base 4 years ago
README.md 29b9a0c50c clean && clean html base 4 years ago
index.js 29b9a0c50c clean && clean html base 4 years ago
package.json 29b9a0c50c clean && clean html base 4 years ago

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