juicydb

1.0.1 • Public • Published

JuicyDB

A new JSON database that's mainly useful for one-guild bots.

JuicyDB

Useful Links

Setup

First, we need to install the package. Do so by writing the following command into your terminal.

$ npm install juicydb

Before anything, you need to create a json file named juicydb.json wherever you want it to be. You can then start using the package. Below, I will show you an example on how to use JuicyDB.

// Require the package & define db

const JuicyDB = require('juicydb');
const db = new JuicyDB('./juicydb.json');

// Set the value test to hello_world
db.set('test', 'hello_world')

// Expected result: hello_world
console.log(db.get('test'));
// Expected result: { 'test': 'hello_world' }
console.log(db.JSON());

Usage

Set a value on a key

db.set('key', 'value');

Get the value from a key

db.get('key');

Check if a key exists

db.has('key');

Delete a key

db.delete('key');

Delete all keys

db.deleteAll();

Sync to disk

db.sync();

Get all keys & values in a JSON response

db.JSON();

Readme

Keywords

Package Sidebar

Install

npm i juicydb

Weekly Downloads

8

Version

1.0.1

License

MIT

Unpacked Size

7.54 kB

Total Files

5

Last publish

Collaborators

  • juicydev