Skip to content

Saluana/jsondb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsondb

Easy to use API for JSON key/value storage

//Create a new db
const myDB = new JsonDB("myDbName", "./folderPath");
myDB.createDB();

//Add an entry to the database
myDB.addEntry({key: "Dogs", value: ["Husky", "Pitbull"]})

//Get an entry from the database
myDB.getEntry("Dogs")

//Remove an entry from the database
myDB.removeEntry("Dogs")

//Update an entry in the database
myDB.updateEntry({key: "Dogs", value: ["Golden Retriever", "Pug"]})

//Get a list of all Key Value pairs based on the value
myDB.addEntry({key: "Hello", value: "world!"})
myDB.addEntry({key: "Goodbye", value: "world!"})
myDB.addEntry({key: "Cya", value: "Later!"})
myDB.getAllByValue("world!") //Returns Hello world! and Goodbye world! as an array with the key and value of all matching items.

//Encrypt the database (Makes it inaccessible until decrypted)
myDB.encrypt("SuperSecretPasswordExample9873!!)

//Decrypt the database and make it accessible again
myDB.decrypt("SuperSecretPasswordExample9873!!")

About

Easy to use API for JSON key/value storage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published