Skip to content

andrewda/js-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Dapr SDK for Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%