Skip to content

❇️ Doxor.js : more comfortable interacting with IndexedDB

License

Notifications You must be signed in to change notification settings

MostafaSaadatnia/doxor.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doxor.js

logo
Offline database in Front-End
library for interacting with IndexedDB


Install Doxor.js using npm

npm i doxor.js

Creating a database

import Doxor from "doxor.js"


const dbName = new Doxor('dbName')

Specify the structure

const usersCollection = {
    name: 'users',
    indexes: [
        {
            key: 'name',
            unique: false
        },
        {
            key: 'email',
            unique: true
        }
    ]
}

dbName.Store(usersCollection)

name : Collection name
indexes [array of objects] : Each object carries collection field properties

result:

Insert Record

dbName.Insert('users',{name:"john",email:"john@email.com"})

Get Record

dbName.get('users',1,result => {
    console.log(result)
})

Get All Records

dbName.getAll('users',result => {
    console.log(result)
})

remove Record

dbName.remove('users',1)

About

❇️ Doxor.js : more comfortable interacting with IndexedDB

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • TypeScript 86.1%
  • JavaScript 10.4%
  • HTML 3.5%