1.0.3 • Published 4 months ago
geardb v1.0.3
Another Local JSON Database
First of all, thank you for using thegears/geardb
How to use
Install
npm install geardb
Usage
// ES6
import GearDB from 'geardb';
// CommonJS
const GearDB = require('geardb');
const db = new GearDB("db.json"); // path to db.
db.set("key", "value");
console.log(db.get("key")); // log 'value'
db.push("list", "value");
console.log(db.get("list")); // log ['value']
db.pull("list", "value");
// -- OR --
db.pull("list", 0);
console.log(db.get("list")); // log []
You can use set, push, pull with await. (This way is recommended.)