New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@gmetrixr/webdis-commands

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gmetrixr/webdis-commands

[![Build Status](https://drone-xr.gmetri.io/api/badges/gmetrixr/webdis-commands/status.svg)](https://drone-xr.gmetri.io/gmetrixr/webdis-commands)

latest
Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
9
28.57%
Maintainers
3
Weekly downloads
 
Created
Source

Build Status

webdis-commands

Client library for making webdis server requests

Exposed Commands:

  • set
  • get
  • del
  • exists
  • sadd
  • srem
  • smember
  • hset
  • hget
  • hmset
  • hmget
  • hdel
  • sismember
  • mget
  • flushdb
  • flushall
  • ping
  • publish
  • unsubscribe

Running example

This repo uses pnpm to run, compile and build code

  • ./sd - start the docker
  • p i - install dependencies. p is an alias for pnpm
  • cd examples
  • p i - install dependencies for examples
  • p watch - start dev server. uses Snowpack

Basic Usage

  import Webdis from "@gmetrixr/webdis-commands";
  const options = {
    db: 1, // set db index
    auth: "username:passwd", // optional auth to webdis server
  };
  const url = "http://localhost:8003";
  const webdis = new Webdis(url, options);
  
  // execute commands
  const response = await webdis.command().ping();
  console.log(response); // [true, "PONG"]

Pub/Sub

  import Webdis from "@gmetrixr/webdis-commands";
  const options = {
    db: 1, // set db index
    auth: "username:passwd", // optional auth to webdis server
  };
  const url = "http://localhost:8003";
  const webdis = new Webdis(url, options);
  
  const channel = "process";
  const cb = (data: string | object) => {
    // cb should always test the typeof data here. parsing can result in either text or js objects
  };
  // subcsription
  const id = webdis.subscribe(channel, cb);
  
  // un-subscription
  webdis.unsubscribe(channel, id); // pass the subscription id 

FAQs

Package last updated on 17 Nov 2021

Did you know?

Socket

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