New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@roadwork/dapr-js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@roadwork/dapr-js-sdk

An unofficial Dapr (https://dapr.io) SDK for Node.js

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Dapr Node.js SDK

This is an unofficial Dapr Node.js SDK that allows interfacing with Dapr applications. The release is to demonstrate the possible way of structuring the SDK for community use.

Note: This library is not ready for production yet

Usage

Initialize through the following:

import Dapr from "@roadwork/dapr-js-sdk";
import express from "express";

const client = new Dapr();

// Pub / Sub
const bindingReceive = (data: any) => { console.log(data); }
client.pubsub.subscribe("pubsub-name", "topic", bindingReceive.bind(this))
await client.pubsub.publish("pubsub-name", "topic", { hello: "world" });

// State
const keys = [{ "key": "value" }, { "key2": "value2" }]; // IKeyValuePair[]
await client.state.save("store-name", );
await client.state.get("store-name", "key");
await client.state.delete("store-name", "key");

// Binding
const bindingReceive = (data: any) => { console.log(data); }
client.binding.receive("binding-name", bindingReceive.bind(this))
await client.binding.send("binding-name", { hello: "world" });

// Invoke
await client.invoke("app-id", "method", { hello: "world" });

FAQs

Package last updated on 12 Dec 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc