0.0.21 • Published 10 months ago

stunks-db v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Stunks-DB

Installation

npm install stunks-db

Usage

import StunksDb from "stunks-db";

const usersDb = new StunksDb("users");
// The name 'users' will be used as the file name

usersDb.ref("11111.lastname").set("Costa");
// 'Costa' was saved in '11111.lastname'.
usersDb.ref("99999.name").set("Yuri");
// 'Yuri' was saved in '99999.name'.

usersDb.ref("11111.age").set(10);
usersDb.ref("11111.age").add(4);
// Now '11111.age' will be set to '14'
usersDb.ref("99999.age").add(32);
// '32' was added in '99999.age'.

usersDb.ref("11111.lastname").delete();
// Now there won't be any value inside '11111.lastname' anymore.

usersDb.ref("11111.lastname").get();
// It will return 'undefined'
usersDb.ref().get();
// It will return { "11111": { "age": 14 }, "99999": { "lastname": "Yuri", "age": 32 } }
0.0.21

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago