1.0.1 • Published 12 months ago

moon.database v1.0.1

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

⭐ Easy Database Creation

First, we create a database (optional) folder and create a file called database.json (optional) and write the following code.

{}

Secondly we define the file path.

const { JsonDatabase } = require("moon.db");

const db = new JsonDatabase({ databasePath: "./database/database.json" });

🙂‍↕️ Example Usage

db.set("key", "value"); // sets the key to value
db.get("key"); // returns value
db.has("key"); // returns true
db.delete("key"); // deletes the key
db.push("array", "value"); // pushes value to the array
db.unpush("array", "value"); // removes value from the array
db.add("number", 5); // adds 5 to the number
db.subtract("number", 5); // subtracts 5 from the number
1.0.1

12 months ago

1.0.0

12 months ago