0.2.8 • Published 11 months ago

all.db v0.2.8

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

all.db

If you found a bug contact me on Discord.

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

// Sets a data in the database
db.set("nonametxt.test","all.db");

Output:

{
  "nonametxt":{
    "test":"all.db"
  }
}

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//Deletes data
db.delete("nonametxt.test");
db.remove("nonametxt.test");

Output:

{}

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//If the data is a number, it adds a certain amount to data
db.add("nonametxt.number",1);

Output:

data + 1

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//If the data is a number, it subtracts a certain amount from it
db.substr("nonametxt.number",1);

Output:

data - 1

const data = require("all.db");
const db = new data({dataPath:"./data.json"});
db.push("nonametxt.array",{name:"NoNametxt"});

//Pushes an element to an array
db.push("nonametxt.array",{name:"NoNametxt"},true); //If data is not an array It will convert the data to an array

Output:

{
  "nonametxt":{
    "array":[
      {
        "name":"NoNametxt"
      }
    ]
  }
}

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

db.pull("nonametxt.array","NoNametxt","name");

//If the data is an array, it deletes the data you want
db.pull("nonametxt.array","NoNametxt");

Output:

{
  "nonametxt":{
    "array":[]
  }
}

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//Fetches you the data
db.get("nonametxt");
db.fetch("nonametxt");

Output:

"all.db"

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//Checks the data is available
db.exists("nonametxt.test");
db.has("nonametxt.test");

Output:

true or false

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//Shows the type of data
db.typeof("nonametxt.typeof"); // true or false (checks the string)

//Compares the type of data with the type you typed
db.typeof("nonametxt.typeof","number");

Output:

true or false

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//If the data is a number, applies math operations to data.
db.math("nonametxt","*",10);

Output:

data * 10

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//If you have entered data, it will find and show you.
db.find("Database", true); //Searches without checking case

Database:

{
  "string": "DATABASE",
  "otherString": "NoNametxt",
  "object": {
    "db": "database"
  },
  "array": ["database"]
}

Output:

[
  [ "string", "DATABASE" ],
  [ "object.db", "database" ],
  [ "array.0", "database" ]
]

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

//If you have entered data, it will filter and show you.
db.filter(([key, value]) => {
    try {
        return value.includes("DataBase");
    } catch (error){};
});

Database:

{
  "string": "DataBase",
  "otherString": "NoNametxt",
  "object": {
    "db": "DataBase"
  },
  "array": [ "DataBase" ]
}

Output:

{ 
  "string": "DataBase",
  "array": [ "DataBase" ] 
}

const data = require("all.db");
const db = new data({dataPath:"./data.json"});

db.getAll.text(true); //If output true it shows the file as readable, otherwise it shows the file as a single line

db.getAll.save(path); //Saves the file (Path is not required)

Output:

{ All Data }

Version 0.1.9 *

+db.gettAll.text() Fixed

Thx for use all.db.

Discord.

0.2.8

11 months ago

0.2.7

11 months ago

0.2.6

11 months ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.2

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago