0.1.0 • Published 2 years ago
fast.db v0.1.0
How to use fast.db.
first install the package.
npm i fast.db
secound create a new file and import the package.
const data = require('fast.db');
const app = new data("database");
#Usage
to set a new data
app.set(name, value) // app.set("fast", "hello"); // set a string value
// app.set("fast", ["hello", "bye", "welcome"]) // set a array value
// app.set("fast", {name: "fast.db", age: 1w }) // set a object value
......
app.get(name); // app.get("fast") => {name: "fast.db", age: 1w } // get data with name
......
app.delete(name); // app.delete("fast") // to delete an data with name
......
app.set("goodP", ["joe", "slayver", "redstoon"]) // set a new array
console.log(app.get("goodP")) => ["joe", "slayver", "redstoon"]
app.push("goodP", "soly"); // push a new data to array
console.log(app.get("goodP")) => ["joe", "slayver", "redstoon", "soly"];
.....
you have move() function to move data from the old file to a new file // app.move("data", "newData");
.....
app.set("test", {
name: "elon",
age: "32"
});
console.log(app.get("test")) => {name: "elon", age: "32"};
app.update(objectName, keyName, newValue);
app.update("test", "name", "ziad");
console.log(app.get("test")) => {name: "ziad", age: "32"};
....
app.reset() // to reset all file data.