You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

danielb.db

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danielb.db

A complete and easy database of better-sqlite3 for discord.

1.2.4
latest
Source
npmnpm
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

Danielb.db

Logo

node-current GitHub contributors npm

Installation

npm install danielb.db

Documentation

const db = require('danielb.db')
db.set('test', 'test') //set key as string => test
db.add('test1', 1) // add number to key (if key dont exites the key will be the number) => 1
db.remove('test1', 1) // remove number to key (if key dont exites the key will be 0) => 0
db.subtract('test1', 1) // remove number to key (if key dont exites the key will be 0) => 0
db.math('test1', 5, '*') // use another operator (in the example its multiplier) => 5

db.all() // get all keys and values in the databse in array => [{ ID: 'test1', data: 1}, { ID: 'test', data: 'test' }]
db.getAll() // get all keys and values in the databse in array => [{ ID: 'test1', data: 1}, { ID: 'test', data: 'test' }]
db.fetchAll() // get all keys and values in the databse in array => [{ ID: 'test1', data: 1}, { ID: 'test', data: 'test' }]
db.toJson() // get all keys and values in the databse in json => {'test1': 1, 'test': 'test' }

db.size() // return number of keys in the database => 2

db.backup() // backup all database in new file => true

db.deleteAll() // delete all keys and values in the database => true
db.clear()// delete all keys and values in the database => true

db.delete('test') // delete key in the database => true
db.del('test') // delete key in the database => true

db.get('test') // get key in the database => 'test'
db.fetch('test') // get key in the database => 'test'

db.has('test') // check if key exites in the databse => true
db.exists('test') // check if key exites in the databse => true
db.includes('test') // check if key exites in the databse => true

db.type('test') // get type of key in the database => string
db.typeof('test') // get type of key in the database => string

Example

const Discord = require("discord.js");
const client = new Discord.Client({ intents: Object.keys(Discord.Intents.FLAGS) });
const db = require("danielb.db");
client.on("ready", () => {
   console.log(`Logged in as ${client.user.tag}`);
});

client.login("TOKEN");

Keywords

database

FAQs

Package last updated on 25 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.