An easy database for people to use.


Keywords
database, npm, package, sasial-roblox
License
MIT
Install
npm install basic.db@0.2.15

Documentation

NPM info

dependencies Status Build Status Discord server NPM downloads NPM version

Basic.db

This module is a simple Node.js based database package for Discord.js projects. The commands available are:

  • dbset: Set the database
  • dbreset: Clear the database.
  • dbget: Get the infomation in the database, if none it will create it.
  • wait : Delay Command; Async function is NOT required for this.

Installation

Pre-installation:

  • None Installation:
  • npm install basic.db --save If you have troubles installing, plesase submit an issue, or for faster help join the discord server at https://discord.gg/hvJPUwR.

Example

dbcreate

This is now depcapritated. To check if a db exists use db.dbget.

// This code is not needed. To check if a db exists use db.dbget, 
var db = require("basic.db")
db.dbcreate("dbname")

dbset - Set a Database

var db = require("basic.db")
var testing = "This is a test"
db.dbset("test",testing)

dbreset - Reset a database

var db = require("basic.db")
db.dbreset("dbname")

dbget - Get a database

var db = require("basic.db")
var get = await db.dbget("dbname") /* You are not required to use await,
though if you do not use await, the varible will not update. */
console.log(get)

wait - Wait for a period of time. (Async is NOT required)

var db = require("basic.db")
await db.wait(100)

Full Example

var db = require("basic.db")
console.log(db.dbget("db"))
db.wait(100).then(() => {
  db.dbset("db","Test")
  db.wait(100).then(() => {
    console.log(db.dbget("db"))
  });
});