aquadb
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i aquadb

    Weekly Downloads

    29

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    162 kB

    Total Files

    19

    Last publish

    Collaborators

    • npm