continuable-cache

Cache a continuable

3 个版本
安装
npm install continuable-cache
yarn add continuable-cache
pnpm add continuable-cache
bun add continuable-cache
README

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

版本列表
0.3.1 2014-01-30
0.2.1 2014-01-30
0.1.1 2013-05-08