1.0.0-beta • Published 3 years ago
vexdatabase v1.0.0-beta
VEX Projects • vexdatabase
- A simple object-oriented database package made with vweevers's level package.
To use it, you need to install the
level
anddeasync
modules.
Documentation | Developer Blog |
---|---|
https://sherlockyigit.github.io/vexdatabase-docs/vexDatabase.html | Soon.. |
Update note (1.0.0-beta):
- Bugs have been fixed.
Installation steps
npm install vexdatabase --save
Functions
all()
- You fetch all the data saved in the database.
let db = require("vexdatabase");
db = new db();
console.log(db.all());
/*
{ data.. }
*/
set(key, value)
- Sets data in created database.
let db = require("vexdatabase");
db = new db();
console.log(db.set("a.b.c", "Test!")) // Test!
get(key)
- You check if there is data in the database created.
let db = require("vexdatabase");
db = new db();
console.log(db.get("a.b.c")) // Test!
has(key)
- You check if there is data in the database created.
let db = require("vexdatabase");
db = new db();
console.log(db.has("a.b.c")) // If data is deleted, the output is true, if it is not deleted, false
add(key, value)
let db = require("vexdatabase");
db = new db();
console.log(db.add("a.b.c", 1)) // 1
substract(key, value)
- You add subtract to the created database.
let db = require("vexdatabase");
db = new db();
console.log(db.substract("a.b.c", 1)) // 0
push(key, value)
- You push data to the array in the database created with the key.
let db = require("vexdatabase");
db = new db();
console.log(db.push("a.b.c", "Test!")) // [ "Test!" ]
unpush(key, value)
- You unpush data to the array in the database created with the key.
let db = require("vexdatabase");
db = new db();
console.log(db.unpush("a.b.c", "Test!")) // []
delete(key)
- You delete data from the created database.
let db = require("vexdatabase");
db = new db();
console.log(db.delete("a"));
/*
If data is deleted, the output is true, if it is not deleted, false
*/
deleteAll(key)
- You delete all the data in the database.
let db = require("vexdatabase");
db = new db();
console.log(db.deleteAll());
/*
If data is deleted, the output is true, if it is not deleted, false
*/