1.2.8 • Published 5 months ago

frupa.db v1.2.8

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

❓ Ne işe yarar? (What is for?)

• Bu modül: Basit JSON tabanlı bir database modülüdür.

📦Kurulum (Installation)

npm i frupa.db

🗿 Örnekler (Example)

const frupa = require("frupa.db");
const db = frupa();

// 11 method
// 1;
db.set("Hello","Merhaba");
// key -> Hello | value -> Merhaba
db.set("Hello", {
    id: 8488,
    content: "selamlar"
});
// key -> hello | value -> {id: 8488, content: "selamlar"}

// 2;
const bakkal = db.get("Hello");
const bakkals = db.find("Hello");
const market = db.fetch("Hello");
console.log(bakkal);
console.log(bakkals);
console.log(bakkal.id);
console.log(market);
//  {id: 8488, content: "selamlar"}
//  {id: 8488, content: "selamlar"}
//  8488
//  {id: 8488, content: "selamlar"}
// 2sinden birini istersen kullanabilirsin

// 3;
db.add("yunus", 4);
db.add("yunus", 6);
// -> key -> yunus | value -> 4
// -> key -> yunus | value -> 10
db.add("yunus", "selam");
db.add("yunus", "seslam");
// Çıktı : key -> yunus | value -> 10selamseslam

// 4;

db.push("selam", "kerem");
db.push("selam", "mehmet");
db.push("selam", "ahmet");
db.push("selam", ["Top", "Yok", "İşler"]);

// Çıktı 
/*
value: ["kerem", "mehmet", "ahmet", "Top", "Yok", "İşler"];
 */

// 5;
db.pull("selam", "ahmet") 
// NOT: Büyük küçük harfe duyarlıdır!
// Çıktı;
//value: ["kerem", "mehmet", "Top", "Yok", "İşler"];
db.pull("selam", ["kerem", "Top", "Yok"]) 
//value: ["mehmet", "İşler"];

// 6;

db.add("yunus", 50)
db.subtract("yunus",20)
// value: "30"

// 7;

db.delete("yunus")
// yunus silindi

// 8;
db.reset()

/* [{
    key: "selam",
    ...
}]

Sonrası:

[]
*/
1.2.8

5 months ago

1.2.7

5 months ago

1.2.6

5 months ago

1.2.5

5 months ago

1.2.4

6 months ago

1.2.1

6 months ago

1.2.0

6 months ago

1.0.0

6 months ago