An open API service indexing awesome lists of open source software.

https://github.com/extra-memoize/extra-disk-cache

🌿
https://github.com/extra-memoize/extra-disk-cache

esm library nodejs npm-package typescript

Last synced: 10 months ago
JSON representation

🌿

Awesome Lists containing this project

README

          

# @extra-memoize/extra-disk-cache
The adapter for [extra-disk-cache].

[extra-disk-cache]: https://www.npmjs.com/package/extra-disk-cache

## Install
```sh
npm install --save @extra-memoize/extra-disk-cache
# or
yarn add @extra-memoize/extra-disk-cache
```

### API
#### DiskCache
```ts
class DiskCache implements ICache {
constructor(
view: DiskCacheView
, timeToLive?: number
)
}
```

#### StaleWhileRevalidateDiskCache
```ts
class StaleWhileRevalidateDiskCache implements IStaleWhileRevalidateCache {
constructor(
view: DiskCacheView
, timeToLive: number
, staleWhileRevalidate: number
)
}
```

#### StaleIfErrorDiskCache
```ts
class StaleIfErrorDiskCache implements IStaleIfErrorCache {
constructor(
view: DiskCacheView
, timeToLive: number
, staleIfError: number
)
}
```

#### StaleWhileRevalidateAndStaleIfErrorDiskCache
```ts
class StaleWhileRevalidateAndStaleIfErrorDiskCache implements IStaleWhileRevalidateAndStaleIfErrorCache {
constructor(
view: DiskCacheView
, timeToLive: number
, staleWhileRevalidate: number
, staleIfError: number
)
}
```