npm.io
1.1.6 • Published 6 years ago

tiny-localstorage

Licence
ISC
Version
1.1.6
Deps
1
Size
3 kB
Vulns
0
Weekly
0

What is that?

Tiny "TLS" Local Storage it's just a HTML5/JS Local Storage "things" to store and get stuff!

Installing

Be sure you have Node JS installed.
npm i tiny-localstorage

Usage

First thing is import TLS
import TLS from 'tiny-localstorage'

Now, you can save TLS into a variable (optional, you can use directly)
let tls = TLS

You can be happy with these methods()

• SET
Insert one item like a json object or some variable passing its name as string type and the object itself as parameter
tls.set("itemName", itemContent)

• GET
Get one item passing its name as string parameter
tls.get("itemName")

• DELETE
Delete one item passing its name in string format as parameter
tls.del("itemName")

• CHECK
Return true if exist a item passing its name as string parameter
tls.chk("itemName")

• CLEAR
...and all storage is gone! Forever...
tls.clr()

Keywords