# liquidcache

> [![CodeQL](https://github.com/FlaringPhoenix/LiquidCache/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/FlaringPhoenix/LiquidCache/actions/workflows/codeql-analysis.yml) ![npm](https://img.shields.io/npm/v/liquidcache) ![license](htt

Latest version **2.0.0** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install liquidcache
pnpm add liquidcache
yarn add liquidcache
bun add liquidcache
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-11-07 |
| First published | 2021-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | FlaringPhoenix |
| Maintainers | flaringphoenix |

## Links

- npm: https://www.npmjs.com/package/liquidcache
- Repository: https://github.com/FlaringPhoenix/LiquidCache
- Homepage: https://github.com/FlaringPhoenix/LiquidCache#readme
- Issues: https://github.com/FlaringPhoenix/LiquidCache/issues
- npm.io page: https://npm.io/package/liquidcache

## Recent versions

- 2.0.0 (latest) — 2023-11-07
- 1.0.0 — 2021-04-15

## README

[![CodeQL](https://github.com/FlaringPhoenix/LiquidCache/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/FlaringPhoenix/LiquidCache/actions/workflows/codeql-analysis.yml)
![npm](https://img.shields.io/npm/v/liquidcache)
![license](https://img.shields.io/github/license/FlaringPhoenix/LiquidCache)

# LiquidCache

LiquidCache is an easy-to-setup, map-based caching system for Node.js, written in TypeScript. It allows you to store key-value pairs in memory and configure cache expiration intervals for optimized data retrieval.

## Features

- In-memory storage of key-value pairs for fast access.
- Configurable cache expiration intervals to ensure data freshness.
- Type-safe operations due to TypeScript integration.
- Straightforward API for managing cache data.

## Installation

Install LiquidCache using npm:

```bash
npm install liquidcache
```

## Usage

Make sure to compile the TypeScript to JavaScript before using LiquidCache:

```bash
npm run build
```

Here's how you can use LiquidCache in your TypeScript code:

```ts
import { LiquidCache } from 'liquidcache';

// Create a new cache instance
const cache = new LiquidCache<string>();

// Set a value in the cache
cache.set('name', 'FlaringPhoenix');

// Retrieve a value from the cache
const value = cache.get('name'); // 'FlaringPhoenix'

// Remove a value from the cache
cache.delete('name');

// Set a value in the cache with an expiration time (in milliseconds)
cache.set('name', 'FlaringPhoenix', 5000);

// After 5 seconds, 'name' will be automatically removed from the cache
```

## Support

If you need help with configuring or using LiquidCache, please open an issue [here](https://github.com/FlaringPhoenix/LiquidCache/issues/new).

## Contributing

Contributions are welcome! For significant changes, please open an issue first to discuss what you would like to change. Don't forget to update tests as necessary.

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/FlaringPhoenix/LiquidCache/blob/master/LICENSE) file for details.

---
_Source: https://npm.io/package/liquidcache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
