2.2.1-pre • Published 3 years ago

darkdb v2.2.1-pre

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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
2.2.1-pre

3 years ago

2.2.0-pre

3 years ago

2.1.0-pre

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.2

3 years ago

1.1.1-beta

3 years ago

1.1.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago