aquadb

A fast and simple database handler for Browser and Node.

Usage no npm install needed!

<script type="module">
  import aquadb from 'https://cdn.skypack.dev/aquadb';
</script>

README

AquaDB

Codacy Badge All Contributors NPM Downloads

A fast and simple database handler for Browser and Node.

Installation

NPM

npm install aquadb

YARN

yarn add aquadb

Wiki

You can go here by clicking.

Basic Usages

Node Usage

const AquaDB = require("aquadb");
const Adapter = require("aquadb/adapters/JsonDB", {
  "name": "crazy-database",
  "separator": ".",
  "autoFile": true,
  "ignoreWarns": false
});
const db = new AquaDB(Adapter);

db.on("data", (packet) => {
    console.log(packet);
});

db.set("x.y.z", "test"); // {"x": {"y": {"z": "test"}}}
db.get("x"); // {"y": {"z": "test"}}
db.has("x"); // true
db.delete("x.y.z"); // true
db.all(); // {"x": {"y": {}}}
db.deleteAll(); // true

Browser Usage

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/aquadb/dist/AquaDB.js"></script>
    <script src="https://unpkg.com/aquadb/dist/LocalStorage.js"></script>
    <title>AquaDB</title>
  </head>
  <body>
    <script>
        const db = new AquaDB(LocalStorage, {
          "name": "crazy-database",
          "separator": "."
        });

        db.on("data", (packet) => {
            console.log(packet);
        });

        db.set("x.y.z", "test"); // {"x": {"y": {"z": "test"}}}
        db.get("x"); // {"y": {"z": "test"}}
        db.has("x"); // true
        db.delete("x.y.z"); // true
        db.all(); // {"x": {"y": {}}}
        db.deleteAll(); // true
    </script>
  </body>
</html>

Click here for more features.

Adapters

Node

JsonDB | BsonDB | YamlDB

Browser

LocalStorage

Contributors


Ceyhun

💻 📖 🤔 📆 ⚠️

If you want to help, you can open a issue.