0.0.4 • Published 5 years ago
aquadb v0.0.4
AquaDB
A fast and simple database handler for Browser and Node.
Installation
NPM
npm install aquadbYARN
yarn add aquadbWiki
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(); // trueBrowser 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
If you want to help, you can open a issue.
