continuable-cache
Cache a continuable
Last updated 11 years ago by raynos .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install continuable-cache 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.3.1                                ...           latest (11 years ago)

3 Versions

  • 0.3.1                                ...           11 years ago
  • 0.2.1                                ...           11 years ago
  • 0.1.1                                ...           12 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE