Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tom910/s3-fifo-cache
https://github.com/tom910/s3-fifo-cache
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tom910/s3-fifo-cache
- Owner: Tom910
- License: mit
- Created: 2024-01-01T13:11:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-01T15:28:21.000Z (about 1 year ago)
- Last Synced: 2024-10-16T06:31:46.305Z (3 months ago)
- Language: TypeScript
- Size: 59.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# s3-fifo-cache
More information about this algorithm you can find in [this article](https://amarchenko.dev/blog/2023-10-12-memory-cache/)size: 0.8Kb after gzip
## How to Install
```bash
npm install --save s3-fifo-cache
```## How to Use
```typescript
import { S3FifoCache } from 's3-fifo-cache';const cache = new S3FifoCache(100);
cache.set("key", "value");
cache.set("key2", "value");
cache.get("key") // -> "value"cache.has("key") // -> true
cache.delete("key");
cache.get("key") // -> undefinedcache.clear();
```