[go: up one dir, main page]

@availity/localstorage-core
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

localstorage-core

Wraps localStorage with utility functions

Version

Install

npm install @availity/localstorage-core --save

Usage

import * as avLocalStorage from '@availity/localstorage-core';

avLocalStorage.set('myKey', 'myValue');
console.log(avLocalStorage.get('myKey')); // logs: "myValue"

Methods

get(key)

Returns value stored at key, will attempt to parse JSON stored there.

set(key, value)

Sets key to value in localStorage. Will stringify objects if needed.

remove(key)

Removes key from localStorage.

getKeys(searchKey)

Returns array of all keys that match the searchKey string or RegExp.

removeKeys(searchKey)

Remove all keys that match the searchKey string or RegExp.

getSessionBust()

Returns session key set by Availity on login.

Readme

Keywords

Package Sidebar

Install

npm i @availity/localstorage-core

Weekly Downloads

31

Version

3.0.0

License

MIT

Unpacked Size

11.5 kB

Total Files

7

Last publish

Collaborators

  • lauroxx
  • dznjudo
  • availity-cicd-bot
  • azeigler
  • dnoler
  • jselden
  • cbaker1
  • twarner
  • gregmartdotin
  • hnicbaker
  • chrishavekost
  • jordan-a-young