Eric Foster 35b96bc934 initial commit 6 年之前
..
test initial commit 6 年之前
.jshintrc initial commit 6 年之前
.npmignore initial commit 6 年之前
.testem.json initial commit 6 年之前
.travis.yml initial commit 6 年之前
LICENCE initial commit 6 年之前
README.md initial commit 6 年之前
index.js initial commit 6 年之前
package.json initial commit 6 年之前

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