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
Dapr javascript sdk package can be installed as:
npm install dapr-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
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
- Make the
protobuf.sh
executable
sudo chmod +x protobuf.sh
- Run the
protobuf.sh
script
./protobuf.sh
From the root directory:
cd examples/simple
npm install ../..
-
Update the version in package.json
-
From the root directory:
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