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
🌿
- Host: GitHub
- URL: https://github.com/extra-memoize/extra-disk-cache
- Owner: extra-memoize
- License: mit
- Created: 2022-04-06T03:47:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-07-04T08:25:36.000Z (about 1 year ago)
- Last Synced: 2025-08-08T16:28:50.346Z (11 months ago)
- Topics: esm, library, nodejs, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@extra-memoize/extra-disk-cache
- Size: 1.73 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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
)
}
```