Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

emo-db

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emo-db

JSON Based Database, Specifically For Normal Discord Bots

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Emo DB

  • JSON Based Database, Specifically For Normal Discord Bots

Example

const db = require("emo-db");
// GET Data Some How | You Need To Replace It With Your Data
const data = getDataSomeHow();

// Set Property | Key - String | Value - Any (Object, Array, String, ...)
db.set("John", data);
db.set("John-2", data);
db.set("Balance", data.balance);
db.set("Fruits", data.fruits);
db.set("Temporary-Data", data.temp);
// Delete Property | Key - String
db.remove("Temporary-Data");
// Fetch Property | Key - String | Alias - get
db.fetch("John");
db.get("John");
// Check If Property Exists | Key - String | Lodash GET - False
db.has("John");
// Add Value To Property | Key - String | Property Value Type - Number | Value - Number
db.add("Balance", 100);
// Subtract Value From Property | Key - String | Property Value Type - Number | Value - Number
db.subtract("Balance", 100);
// Push Element To Array-type Property | Key - String | Property Value Type - Array | Value - Any (Object, Array, String, ...)
db.push("Fruits", "Apple");
db.push("Fruits", "Banana", "Orange");
// Filter Specific Properties From Database | Func - Function | Type - Array (Default) Or Object
db.filter((element) => element.key.startsWith("John"));
db.filter((element) => element.key.startsWith("John"), "Object");
// Be Careful With value Property, It Can Be Any (Object, Array, String, ...) So Check Type Before Checking Anything
db.filter((element) => typeof element.value === "number");
db.filter((element) => typeof element.value === "number" && element.value === 0);
// GET All Properties From Database | Type - Array (Default) Or Object
db.all();
db.all("Object");
// Clear Database
db.clear();
// Destroy Database (Clear Database & Delete Database File)
db.destroy();

Why Emo DB?

  • Simple & Easy To Use
  • Small But Powerful
  • Discord Support
  • Want More? Use Private Functions

Private Functions

  • Please Use These Functions Carefully, Thanks
const db = require("emo-db");
const data = getDataSomeHow();

// Set Whole Database File Content Into Provided JSON Content
db.__set({});
// Read Whole Database File Content
db.__read();
// Delete Whole Database File (Content Too)
db.__delete();
// Throw An Error Using emo-db
db.__err("Fake Error Message From emo-db NPM Package");
// FS (File System) Package
db.fs.readFileSync(options);
db.fs.writeFileSync(options);
db.fs.unlinkSync(options);

Information

Note: I Didn't Created This Fully By Myself & It's NOT For Huge Projects

  • Discord Server - Click Me

  • Documentation - Click Me

  • Github Repository - Click Me

  • Thank You For Reading & Using This Package ;)

Keywords

FAQs

Package last updated on 06 May 2021

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc