darkdb

2.2.1-pre • Public • Published

DarkDB

Description

Database module for json

Install

npm i darkdb --save

Example

Setup

const DarkDB = require("darkdb")
const dbOptions = {
    "name": "darkdb",
    "separator": ".",
    "autoFile": true,
    "jsonSpaces":4,
    "language":"en" // tr, en or ru
};
const db = new DarkDB(dbOptions);

Set - Get - Delete

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

Has Check - Get All - Delete All

db.has("x"); // true
db.all(); // {"x": {"y": {}}}
db.deleteAll(); // true

Push - Unpush

db.push("x", "hello") //  ["hello"]
db.push("x", "world") //  ["hello", "world"]
db.unpush("x", "hello") // ["world"]

Add - Remove

db.add("x",10)//10
db.remove("x",1)//9

Package Sidebar

Install

npm i darkdb

Weekly Downloads

0

Version

2.2.1-pre

License

MIT

Unpacked Size

7.98 kB

Total Files

10

Last publish

Collaborators

  • mr_dark