Socket
Socket
Sign inDemoInstall

inmemdb-client

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    inmemdb-client

A client for communicating with inmemdb server


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

inmemdb-client

A client to communicate with inmemdb server

NPM JavaScript Style Guide

Install

npm
$ npm install --save inmemdb-client

Usage

inmemdb-client exposes all the api used for communicating with inmemdb

All requests return a promise of a value found in the result. If an error occurs (eg. invalid parameters), the promise rejects with the specific error message

    // Instantiate inmemdb
    const Client = require('inmemdb-client');
    const inmemdb = new Client('127.0.0.1', '9005');


    // Make requests
    (async () => {
        await inmemdb.set('name', 'musah');

        const result = await inmemdb.get('name');

        console.log(result) // logs musah to the console
    })();

API

    ping(): Promise<"PONG">;
    get(key: string): Promise<string>;
    set(key: string, value: string): Promise<"OK">;
    setex(key: string, seconds: number, value: string): Promise<"OK">;
    expire(key: string, seconds: number): Promise<"OK">;
    ttl(key: string): Promise<number>;
    del(key: string): Promise<"OK">;
    sadd(setName: string, value: string): Promise<"OK">;
    smembers(setName: string): Promise<Array<string>>;
    rpush(listName: string, value: string): Promise<"OK">;
    lpush(listName: string, value: string): Promise<"OK">;
    lrange(listName: string, startIndex: number, endIndex: number): Promise<Array<string>>;
    lpop(listName: string): Promise<string>;
    llen(listName: string): Promise<number>;

Keywords

FAQs

Last updated on 20 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc