0.1.5 • Published 6 months ago

whisky.db v0.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

İlk önce modülü indiriyoruz.

npm i whisky.db

Modülü tanımlıyoruz.

const dbModule = require("whisky.db")
const db = new dbModule.createDatabase()
//Sizin için bir JSON dosyası'da açar.

Kullanımlar / Usages

const dbModule = require("whisky.db")
const db = new dbModule.createDatabase()

db.set("developer", "whisky") // { "developer": "whisky" }

db.get("developer") // whisky

db.has("developer") // true

db.push("test_array", "Test") // { "test_array": [ "Test" ] }

db.add("numbers", 1) // { "numbers": 1 }
db.add("numbers", 28) // { "numbers": 29 }

db.substract("numbers", 17) // { "numbers": 12 }

db.delete("numbers") // Veri silindi. - Data deleted.

db.all() // [ { ID: "developer", data: "whisky" }, { ID: "test_array", data: [ "Test" ] } ]

db.deleteAll("CONFIRM") // Tüm veriyi silmek için CONFIRM yazmalısınız. - You must type CONFIRM to delete all data.