This package has been deprecated

Author message:

This project has been renamed. https://www.npmjs.com/package/storage-box

@litehex/storage-box
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

storage-box

Storing data in key-value structure to multiple different storages.

npm npm bundle size

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

Package Sidebar

Install

npm i @litehex/storage-box

Weekly Downloads

18

Version

0.2.1

License

MIT

Unpacked Size

26.6 kB

Total Files

7

Last publish

Collaborators

  • shahradelahi