Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wayfair-incubator/expirable-storage
🗄️ Implementation of an expirable data storage based on native Web Storage API.
https://github.com/wayfair-incubator/expirable-storage
expirable hacktoberfest localstorage sessionstorage
Last synced: about 6 hours ago
JSON representation
🗄️ Implementation of an expirable data storage based on native Web Storage API.
- Host: GitHub
- URL: https://github.com/wayfair-incubator/expirable-storage
- Owner: wayfair-incubator
- License: mit
- Created: 2022-02-15T00:03:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-31T22:31:43.000Z (7 days ago)
- Last Synced: 2024-10-31T23:23:01.801Z (7 days ago)
- Topics: expirable, hacktoberfest, localstorage, sessionstorage
- Language: TypeScript
- Homepage: https://npmjs.com/expirable-storage
- Size: 490 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Authors: AUTHORS
Awesome Lists containing this project
README
# Expirable storage
[![OSS Template Version](https://img.shields.io/badge/OSS%20Template-0.3.5-7f187f.svg)](https://github.com/wayfair-incubator/oss-template/blob/main/CHANGELOG.md)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![Build Status](https://github.com/wayfair-incubator/expirable-storage/actions/workflows/build.yml/badge.svg)](https://github.com/wayfair-incubator/expirable-storage/actions/workflows/build.yml)
[![NPM version](https://img.shields.io/npm/v/expirable-storage.svg?logo=npm)](https://npmjs.org/package/expirable-storage)
[![NPM downloads](https://img.shields.io/npm/dm/expirable-storage.svg?style=flat)](https://npmjs.org/package/expirable-storage)## About The Project
Expirable data storage based on `localStorage` and `sessionStorage`.
## Getting Started
To get a local copy up and running follow these simple steps.
### Prerequisites
Be sure you use latest stable version of `npm`:
```sh
npm install npm@latest -g
```## Usage
```bash
npm install expirable-storage
# Or
yarn add expirable-storage
``````js
import {
expirableLocalStorage,
expirableSessionStorage,
} from "expirable-storage";
const expires = 900; // 900 seconds (15 minutes)expirableLocalStorage.setItem("key1", "value1", expires);
expirableLocalStorage.getItem("key1");expirableSessionStorage.setItem("key2", "value2", expires);
expirableSessionStorage.getItem("key2");
```## Roadmap
See the [open issues](https://github.com/wayfair-incubator/expirable-storage/issues) for a list of proposed features (and known issues).
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. For detailed contributing guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md)
## License
Distributed under the `MIT` License. See [LICENSE](LICENSE) for more information.
## Contact
Valentin Podkamennyi - [@vpodk](https://twitter.com/vpodk)
Project Link: [https://github.com/wayfair-incubator/expirable-storage](https://github.com/wayfair-incubator/expirable-storage)
## Acknowledgements
This template was adapted from
[https://github.com/othneildrew/Best-README-Template](https://github.com/othneildrew/Best-README-Template).