wrld-database-json

1.0.0 • Public • Published

⚙️・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

/wrld-database-json/

    Package Sidebar

    Install

    npm i wrld-database-json

    Weekly Downloads

    4

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    8.96 kB

    Total Files

    4

    Last publish

    Collaborators

    • 999.frost