Skip to content

henryaraujo/LSLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Creating lib for handling the localStorage and sessionStorage APIs

How to use

const store = new storeSQL('prefix_here',/*localStorage or sessionStorage*/);

Create new key(table)

let books = [{
    id:1,
    title: "Christine",
    author: "Stephen King",
    year: "1983",
    pages: 503,
    rating:5
  }];
  
store.create('books',books);

Insert new data

store.insert('books',{
    id:2,
    title: "The Lord of the Rings",
    author: "J.R.R. Tolkien",
    year: "1955",
    pages: 434,
    rating: 5
  });

Select data

store.select('books'); // get all data
store.select('books',['title','author','year']); // get fields 

Remove data

store.remove('books');// remove for key
store.remove(['books','authors']); // remove using array

List key(table)

store.list();

Clear all

store.clearAll();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published