⚡ beta.db V3.0.0
- Simple & Fast JSON Database
FIX & IMPROVE PACKAGE UPDATE V3
😏 Some Of Features
- Multiple Json Files
- Simple And Easy To Get Started
- Backup System
🔌 Getting Started
- You can start install the package on your project:
npm i beta.db
- Then Start define it like this:
const { Database } = require('beta.db')
const db = new Database()
import { Database } from 'beta.db';
const db = new Database();
💡 Some Notes
- For the Database class, you can pass in a parameter to set a file rather than using the default file!
- If the file dosen't exist, it will create it
- Path automatically set to ./
🔋 Examples
const { Database } = require('beta.db');
const db = new Database()
var object1 = {key: true, key2: "true"}
db.set('Object', object1);
var array1 = ['element', 'element2']
db.set('Array', array1);
db.push('Array', 'element3');
db.objectFetch('Object', 'key');
db.arrayFetch('Array', 1);
db.fetch('data');
db.get('data');
db.fetchAll();
db.all();
db.remove('data');
db.delete('Array', 'element3');
db.deleteKey('object', 'key');
db.deleteEach('data');
db.clear();
db.destroy();
db.has('data');
db.add('data', 1);
db.subtract('data', 1);
db.math("eco", "+", 10);
💯 Math Function
const { Database } = require('beta.db');
const db = new Database()
db.set(`eco`, 15)
var newEco = db.math("eco", "-", 10);
db.set(`eco`, newEco)
📚 Multiple Files
const { Database } = require('beta.db');
const bot = new Database('bot-config.json');
const servers = new Database('servers-config.json');
const users = new Database('users.json');
servers.push('servers', '800060636041314375');
bot.set('prefix', '#');
users.set('whitelist_747430301654974546', true);
🥶 Data Backup
- You can save your data in a backup file, So if your main database file gets deleted you can backup your data!
- example:
const { Database } = require('beta.db');
const db = new Database();
db.setBackup('backup.json')
const { Database } = require('beta.db');
const db = new Database();
db.loadBackup();
💖 Any Bug Or Suggestion !!
- Contact With Me Discord: AzizJaber#5414
- Or Beta Devs Discord
❗ License
MIT
💌 BetaDev
Discord Server
Website