object-storage-factory
Version:
Object storage factory implemented with the same interface as browser's local storage.
42 lines (27 loc) • 1.55 kB
Markdown
# object-storage-factory
[](https://www.npmjs.com/package/object-storage-factory)

[](https://www.npmjs.com/package/object-storage-factory)
[](https://www.npmjs.com/package/object-storage-factory)
[](https://www.npmjs.com/package/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