1.0.0 β’ Published 4 months ago
storage-box v1.0.0
storage-box is a JavaScript library designed for the purpose of storing data in various structures across multiple storage systems. The primary goal of this library is to offer a straightforward and effective method for data storage.
π Features
- Simple API
- Support for Node.js, Bun and the browser
- Support for multiple storage types (Memory, File, Browser-storage, etc.)
- Multiple data structures (Literals, Hashes, Lists, etc.)
- Time-based key expiration
βοΈ Installation
npm i storage-box
π Usage
import { Client } from '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.
Project Stats
License
MIT Β© Shahrad Elahi
1.0.0
4 months ago
1.0.0-canary.0
4 months ago
1.0.0-canary.1
4 months ago
1.0.0-canary.4
4 months ago
1.0.0-canary.2
4 months ago
1.0.0-canary.3
4 months ago
0.3.1
5 months ago
0.3.0
5 months ago
0.0.4
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago
0.0.0
3 years ago