0.2.1 β’ Published 1 month ago
@litehex/storage-box v0.2.1
storage-box
Storing data in key-value structure to multiple different storages.
Notable Features
- Easy to use API
- Support for Node.js, Bun and the browser
- Support for multiple storage types (memory, file, local storage, etc.)
- Support for time-based expiration
Installation
npm install @litehex/storage-box
π Usage
import { Client } from '@litehex/storage-box';
const client = new Client();
client.setex('key', 'value', 2);
console.log(client.get('key')); // value
// time to live in milliseconds
console.log(client.ttl('key', true)); // 2000
// after 3 seconds
setTimeout(() => {
console.log(client.get('key')); // undefined
}, 3e3);
π¦ Storage Types
π Documentation
For all configuration options, please see the API docs.
Contributing
You can contribute to this project by opening an issue or a pull request on GitHub. Feel free to contribute, we care about your ideas and suggestions.
License
MIT Β© Shahrad Elahi
0.3.0-canary.3
1 month ago
0.3.0-canary.2
1 month ago
0.3.0-canary.1
1 month ago
0.3.0-canary.0
2 months ago
0.2.2-canary.0
2 months ago
0.2.0-canary.0
2 months ago
0.2.0-canary.1
2 months ago
1.0.0-canary.0
2 months ago
0.2.1
2 months ago
0.2.0
2 months ago
0.1.1
3 months ago
0.1.2-canary.0
3 months ago
0.1.1-canary.0
3 months ago
0.1.0
3 months ago
0.1.0-canary.3
3 months ago
0.1.0-canary.2
5 months ago
0.1.0-canary.1
5 months ago
0.1.0-canary.0
5 months ago