1.2.1 • Published 2 years ago

storage-save v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

A package to work with local and session storage on the browser

npm i storage-save

and import one of the storage options (locale or session)

how to work with storage

import { localeStorage } from 'storage-save' or import { sessionStorage } from 'storage-save'

there are 3 methods for both

1. get to get data from storage

localeStorage.get("key")
sessionStorage.get("key")
if you want to get data without parsing, pass the second argument false (default true)
localeStorage.get("key", false)
sessionStorage.get("key", false)

2. set to set data to storage

localeStorage.set("key", data)
sessionStorage.set("key", data)
if you want the method to stringify data, pass true as the third argument (deault false)
localeStorage.get("key", data, true)
sessionStorage.get("key", data, true)

3. remove to remove data from storage

localeStorage.remove("key")
sessionStorage.remove("key")
if you want the method to return data before being deleted, pass true as the second argument (default false)
localeStorage.remove("key", true)
sessionStorage.remove("key", true)
1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago