0.0.6 • Published 4 years ago

@morglod/jsondb v0.0.6

Weekly downloads
8
License
MIT
Repository
-
Last release
4 years ago

@morglod/jsondb

Super simple file db for cli tools / utils.
It syncs changes from fs & changes from program.

npm i @morglod/jsondb
const counterDB = new JsonDB(
    // path
    'example_counter.json',

    // initial data
    () => ({ counter: 0 })
);

await counterDB.init();

setInterval(() => {
    counterDB.commit(cur => {
        cur.counter++;
    });
}, 1000);

After external update hook

jsobDB.afterRead.push(currentData => {
    // ....
})
0.0.6

4 years ago

0.0.5

5 years ago

0.0.3

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago