storage-helper-functions

1.0.2 • Public • Published

StorageHelper

Kind: global class

new StorageHelper()

StorageHelper class

StorageHelper.module.exports

Kind: static class of StorageHelper

new module.exports(storageProvider, [compressed])

Creates an instance of StorageHelper.

Param Type Default Description
storageProvider localStorage | sessionStorage Storage provider, localStorage or sessionStorage
[compressed] boolean false Option to use compression for strings

StorageHelper.store(key, data, [format]) ⇒ void

Stores data to storageProvider

Kind: static method of StorageHelper

Param Type Default Description
key string Key used to identify saved item
data string | object Data to save
[format] 'text' | 'json' "text" Data format

StorageHelper.get(key, [format]) ⇒ any

Gets key from storageProvider

Kind: static method of StorageHelper
Returns: any - - The value of said key

Param Type Default Description
key string Key to retrieve from storage
[format] 'text' | 'json' "text" Format of stored data

Package Sidebar

Install

npm i storage-helper-functions

Weekly Downloads

69

Version

1.0.2

License

MIT

Unpacked Size

13.6 kB

Total Files

5

Last publish

Collaborators

  • alrico88