continuable-cache

WebJar for continuable-cache

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

continuable-cache
Last Version

Last Version

0.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

continuable-cache
WebJar for continuable-cache
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Raynos/continuable-cache

Download continuable-cache

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/continuable-cache/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>continuable-cache</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/continuable-cache/
implementation 'org.webjars.npm:continuable-cache:0.3.1'
// https://jarcasting.com/artifacts/org.webjars.npm/continuable-cache/
implementation ("org.webjars.npm:continuable-cache:0.3.1")
'org.webjars.npm:continuable-cache:jar:0.3.1'
<dependency org="org.webjars.npm" name="continuable-cache" rev="0.3.1">
  <artifact name="continuable-cache" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='continuable-cache', version='0.3.1')
)
libraryDependencies += "org.webjars.npm" % "continuable-cache" % "0.3.1"
[org.webjars.npm/continuable-cache "0.3.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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

Versions

Version
0.3.1