Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/playerony/object-storage-factory
Object storage factory implemented with the same interface as the browser's local storage.
https://github.com/playerony/object-storage-factory
factory interface javascript object storage storage-interface tests typescript wrapper
Last synced: 18 days ago
JSON representation
Object storage factory implemented with the same interface as the browser's local storage.
- Host: GitHub
- URL: https://github.com/playerony/object-storage-factory
- Owner: playerony
- License: mit
- Created: 2021-09-27T16:28:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-03T12:30:26.000Z (over 3 years ago)
- Last Synced: 2024-12-29T20:38:39.471Z (22 days ago)
- Topics: factory, interface, javascript, object, storage, storage-interface, tests, typescript, wrapper
- Language: TypeScript
- Homepage: https://playerony.github.io/object-storage-factory
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# object-storage-factory
[![npm](https://img.shields.io/npm/v/object-storage-factory.svg)](https://www.npmjs.com/package/object-storage-factory)
![types](https://img.shields.io/badge/types-typescript%20%7C%20flow-blueviolet)
[![minzip](https://img.shields.io/bundlephobia/minzip/object-storage-factory.svg)](https://www.npmjs.com/package/object-storage-factory)
[![downloads per month](https://img.shields.io/npm/dm/object-storage-factory.svg)](https://www.npmjs.com/package/object-storage-factory)
[![issues](https://img.shields.io/github/issues/playerony/object-storage-factory.svg)](https://www.npmjs.com/package/object-storage-factory)
[![license](https://img.shields.io/github/license/playerony/object-storage-factory)](https://www.npmjs.com/package/object-storage-factory)Object storage factory implemented with the same interface as the browser's local storage.
# documentation
If you want to get more information about library, just take a look at markdown documentation: **[API Documentation](https://playerony.github.io/object-storage-factory)**.
# installation
```js
yarn add object-storage-factory
npm install object-storage-factory
```# example
```js
const { objectStorageFactory } = require('object-storage-factory');const objectStorage = objectStorageFactory();
objectStorage.setItem('key', 'value');
objectStorage.getItem('key'); // value
objectStorage.getItem('wrong_key'); // null
```# usage
Useful when you will not be able to use localStorage or sessionStorage due to security or other thrown error.
# license
MIT