1.0.1 • Published 3 years ago

juicydb v1.0.1

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

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();
1.0.1

3 years ago

1.0.0

3 years ago

0.9.9

3 years ago