eli.db

0.0.0 • Public • Published

eli.db

Support: Discord Server
Package: NPM Package

Join discord

Installation

  • npm install eli.db

Triggers

  • db.set('', { value: '1' }
  • db.add("value", 1)
  • db.sub("value", 1)
  • db.push("value", {value: "1"} )
  • db.get("value")
  • db.delete("value")
  • db.all()
  • db.clear()

Examples

const Database = require("eli.db");
const db = new Database("./database.json");

db.set('status', { status: 'Online' })
/*
JSON Output:
{
  "status": {
    "status": "Online"
  }
}
*/
db.set('status', { status: 'Offline'})
/*
JSON Output:
{
  "status": {
    "status": "Offline"
  }
}
*/

db.set('money', {userid: '0'})
/*
JSON Output:
{
  "money": {
    "userid": "0"
  }
}
*/

db.add('money', {userid: '5'})
/*
JSON Output:
{
  "money": {
    "userid": "5"
  }
}
*/

db.sub('money', {userid: '5'})
/*
JSON Output:
{
  "money": {
    "userid": "0"
  }
}
*/

db.has("money", {userid: '0'}) // Output: true
db.has("money", {userid: '5'}) // Output: false

console.log(db.all()) // Get the json file

db.delete("money", {userid}) // Deleting the Users money

db.clear() // Clears the database

Package Sidebar

Install

npm i eli.db

Weekly Downloads

5

Version

0.0.0

License

ISC

Unpacked Size

3.99 kB

Total Files

5

Last publish

Collaborators

  • elias33506