geardb
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Another Local JSON Database

GitHub license GitHub stars GitHub forks GitHub issues GitHub pull requests

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.)

Package Sidebar

Install

npm i geardb

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

6.63 kB

Total Files

7

Last publish

Collaborators

  • thegears