Snow 1d0b9c5323 增加了node环境 hai 1 mes
..
test 1d0b9c5323 增加了node环境 hai 1 mes
.jshintrc 1d0b9c5323 增加了node环境 hai 1 mes
.npmignore 1d0b9c5323 增加了node环境 hai 1 mes
.testem.json 1d0b9c5323 增加了node环境 hai 1 mes
.travis.yml 1d0b9c5323 增加了node环境 hai 1 mes
LICENCE 1d0b9c5323 增加了node环境 hai 1 mes
README.md 1d0b9c5323 增加了node环境 hai 1 mes
index.js 1d0b9c5323 增加了node环境 hai 1 mes
package.json 1d0b9c5323 增加了node环境 hai 1 mes

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