Socket
Socket
Sign inDemoInstall

aoi.db

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aoi.db

aoi.db - Database Management System with different types of databases.


Version published
Weekly downloads
465
increased by294.07%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

aoi.db

Discord Server NPM Downloads NPM Version

Table Of Contents

About

aoi.db is a Database system with various database types meant for quick and easy storing datas.

Examples

KeyValue

Setup
CJS
const { KeyValue } = require("aoi.db");

const db = new KeyValue({
  path: "./database/",
  tables: ["test"],
});

db.once("ready", () => {
  console.log("Database ready!");
});

db.connect();
ESM
import { KeyValue } from "aoi.db";

const db = new KeyValue({
  path: "./database/",
  tables: ["test"],
});

db.once("ready", () => {
  console.log("Database ready!");
});

db.connect();
BulkSet
await db.bulkSet("test",{
  key : "Number", {
  value: 1,
}
},{
  key : "String", {
  value: "hello World",
}
});
Set
await db.set("test", "Number", {
  value: 1,
});

await db.set("test", "String", {
  value: "hello World",
});

await db.set("test", "BigInt", {
  value: 2n,
}); // { value : 1 , type : "bigint" } || {value : BigInt("1223432") }

await db.set("test", "Boolean", {
  value: true,
});

await db.set("test", "Object", {
  value: { hello: "world" },
});

await db.set("test", "Arrays", {
  value: [1, 2, 3, 4, 5],
});

await db.set("test", "Date", {
  value: new Date(),
}); // { value : 1234565432 , type : "date" } || {value : "12/12/2022", type : "date" }

await db.set("test", "null", {
  value: null,
});
Get
const string = await db.get("test", "String");
const numbers = await db.get("test", "Numbers");
All
const lerefAndApple = await db.all("test", undefined, Infinity); // Setting limit as Infinity will return all data
Delete
await db.delete("test", "fruits");
await db.delete("test", "leref");
Clear
db.clear("test");
Ping
db.ping;
TablePing
db.tablePing("test");

aoi.db is created for aoi.js but, it's available for anyone to learn and use.

Keywords

FAQs

Last updated on 21 Apr 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc