1.0.6 • Published 10 months ago

dicedb v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

DiceDB Client

DiceDB Client is a Node.js client for interacting with DiceDB, an in-memory real-time database. This client allows you to connect to a DiceDB server, send commands, and retrieve responses.

The easiest way to get started with DiceDB is using Docker by running the following command:

docker run dicedb/dicedb

You can install the DiceDB client using npm:

npm install dicedb

Installation and Commands

For any installation instructions and command usage, check the official DiceDB documentation: DiceDB Installation Guide

Connecting to DiceDB and Using GET/SET Commands

The following example demonstrates how to connect to a DiceDB server and use the SET and GET commands to store and retrieve a value.

Example Code

const DiceDBClient = require('dicedb')
// (default: host=127.0.0.1, port=7379)
const client = new DiceDBClient();

// Connect to the DiceDB server
client.connect(() => {
    console.log('Connected to DiceDB');

    client.SET("MY_KEY","Golchi")
        .then(response => {
            console.log('Set Response:', response);
            // Now, let's get the value we just set
            return client.GET("MY_KEY");
        })
        .then(response => {
            console.log('Get Response:', response);
        })
        .catch(err => {
            console.error('Error:', err);
        });
});
1.0.6

10 months ago

1.0.5

10 months ago

1.0.3

10 months ago

1.0.4

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago