Skip to content
Dapr SDK for Javascript
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update question.md Oct 11, 2019
examples
src Updating version Feb 13, 2020
.gitignore updating instructions in readme and add packagin instructions Oct 16, 2019
CONTRIBUTING.md Adding Contribution guidance in js repo Oct 16, 2019
LICENSE Updating license to MIT Oct 8, 2019
README.md Add missing markdown formatting (#13) Oct 22, 2019

README.md

Dapr SDK for Javascript

This is the Dapr SDK for Javascript, based on the auto-generated proto client.

For more info on Dapr and gRPC, visit this link.

This repo generates following package: dapr.io

Usage

Dapr javascript sdk package can be installed as:

npm install dapr-client

Creating the client

var dapr = require('dapr-client');
var messages = dapr.dapr_pb; 
var services = dapr.dapr_grpc;
var grpc = require('grpc');

const PORT = process.env.DAPR_GRPC_PORT || 50001;
var client = new services.DaprClient(`localhost:${PORT}`, grpc.credentials.createInsecure());

For usage, refer to examples/simple/app.js

Running the code locally.

From the root directory:

cd src
npm install

From the root directory:

cd examples/simple
npm install
dapr run --protocol grpc --grpc-port=50001 node app.js

Use the package from local source

From the root directory:

cd examples/simple
npm install ../../src

Creating and publishing the package

From the root directory:

cd src
npm pack
npm publish --access public

Note --access public will publish the package publicly. For all publish options see https://docs.npmjs.com/cli/publish

You can’t perform that action at this time.