1.1.1 • Published 5 years ago

s-localstorage v1.1.1

Weekly downloads
28
License
-
Repository
github
Last release
5 years ago

s-localstorage

Is a simple library for work with local storage or session storage. Supported types: array, number, boolean, object* Supported object or array if they not included types like function, symbol, etc.

Install

run

npm i s-localstorage

Usage

import {localStorage, sessionStorage} from 's-localstorage'

localStorage.clear()
localStorage.set('key', {'test': 'value'})
localStorage.get('key')
localStorage.remove('key')

sessionStorage.clear()
sessionStorage.set('key', {'test': 'value'})
sessionStorage.get('key')
sessionStorage.remove('key')

You can use defaultValue for get method (default it is null)

localStorage.get('key', {})

If browser not supported localStorage or sessionStorage you find console error message, but all method should works (method get return null or default value)

1.1.1

5 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago