JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q56533F
  • License BSD-3-Clause

Intuitive and easy-to-use storage box.

Package Exports

  • storage-box

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (storage-box) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

StorageBox
CI npm npm bundle size MIT

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

  • Memory (Docs) (default)
  • File-based (Fs) (Docs)
  • Local/Session Storage (Docs)

📚 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

Alt

License

MIT © Shahrad Elahi