A simple JSON database
npm install xenkysdbnpm i xenkysdb`
Setup
`js
const Database = require("xenkysdb")
const db = new Database()
`
All Methods
##### set(key, value)
Set a key and a value.
##### get(key)
Get a key with its values.
##### has(key)
Check if has the key.
##### all()
Get all the keys with them values.
##### delete(key)
Delete the key with its values.
##### clear()
Delete all keys with them values.
##### push(key, element)
Add an element to the key.
##### unpush(key, element)
Remove an element from the key.
##### add(key, number)
Add a number to the key.
##### remove(key, number)
Remove a number from the key.
Examples
`js
const Database = require("xenkysdb")
const db = new Database({
name: "storage", // The optional name of the json file, the default name is storage
directory: "databases", // The optional name of the folder where the json files will be created
separator: "." // The optional separator to switch between keys, the default separator is .
})
db.set("a.b.c", "value") // { "a": { "b": { "c": "value" }}}
db.get("a") // { "b": { "c": "value" }}
db.has("a.b.c") // true
db.all() // { "a": { "b": { "c": "value" }}}
db.delete("a.b.c") // { "a": { "b": {}}}
db.clear() // {}
db.push("a.b", "element") // { "a": { "b": ["element"] }}
db.unpush("a.b", "element") // { "a": { "b": [] }}
db.add("a.c", 4) // { "a": { "b": [] }, { "c": 4 }}
db.remove("a.c", 2) // { "a": { "b": [] }, { "c": 2 }}
``