1.0.0 • Published 2 years ago
wrld-database-json v1.0.0
⚙️・Installation
To install the package, run this on your terminal :
npm i wrld-database-json@latest
or this
yarn add wrld-database-json
🏹・Example
Here's an example of how to use this package easily.
const Database = require("wrld-database-json");
const db = new Database("./users.json");
// Set data in the database ( ./users.json )
db.set("Users", "Frost");
// Get data in the database ( ./users.json )
db.get("Users"); // return : Frost
// Delete data in the database
db.delete("Users");
db.get("Users"); // return : undefined
db.has("Users"); // return : false
// Set data in the database ( ./users.json )
db.set("money", 10);
// add data ( number ) in the database ( ./users.json )
db.add("money", 1); // return : 11
// subtract data ( number ) in the database ( ./users.json )
db.subtract("age", 10); // return : 1
// Set data in the database ( ./users.json )
db.set("fruits", [ "orange" ]);
db.push("fruits", "banana"); // return : [ "orange", "banana" ]
// Delete all the data from all the database
db.deleteAll();
// Get all the data from all the database
db.getAll();
Support
If you need help, contact me on discord here or on github here
1.0.0
2 years ago