5.1.2 • Published 2 years ago

zacron.db v5.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

zacron.db

A JSON Database Module

npm install zacron.db
  • EN | zacron.db is easy to use, useful, new and faster Json based database module.

Releases (v5.1.0)

Set Data With Using APIs.

If you want to save a data from API, there is an easy method for this. Use ".setFromAPI()" for save data from API. Example:

zdb.setFromAPI("https://api.example.com/data", "test_data", { headers: {...} });
// First parameter: Request URL
// Second parameter: Data Name
// (OPTIONAL) Third parameter: Request Options

Auto Open Database File

Database file is now opening automaticly! You must only enter file name.

Definition

There are 3 different definitions:

// Default
const { Database } = require("zacron.db");
const zdb = new Database("<DatabaseFileName>")

// ES6 import
import { Database } from "zacron.db";
const zdb = new Database("<DatabaseFileName>")

Note:

Database File Name Is Optional. If Filename Is Not Specified, Default Filename Is Will Be "database.json". If You Specify A File Name, You Must Open File Manually.

Examples

For Set A Data To Database:

const { Database } = require("zacron.db");
const zdb = new Database("<DatabaseFileName>")

zdb.set("data", "value")

For Fetch A Data From Database:

const { Database } = require("zacron.db");
const zdb = new Database("<DatabaseFileName>")

// zdb.set("data_name", "zacron")

console.log(zdb.fetch("data_name")) //Output: 'zacron'

Methods

Set A Data:

set("data", "value") save("data", "value") setFromAPI("reqURL", "data_name", {})

Fetch A Data:

get("data") fetch("data")

Math:

add("data", number) - Addition subtract("data", number) - Subtraction multiply("data", number) - Multiplication divide("data", number) - Division

Delete A Data - All Datas - Backup Database:

delete("data")

all(limit) - Limit Is Optional.

backup("backup_file_name")

Delete All Datas - Delete Database File:

deleteAll() clear()

destroy()

Type of Value of Data Name - Push Value To Array - Delete Value From Array:

type("data")

push("data", "value")

pull("data", "value")

Discord Server

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

4.1.2

3 years ago

4.1.1

3 years ago

3.5.5

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

2.1.0

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago