Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

depi-node-client

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depi-node-client

GRPC Client for communicating with depi from node in typescript or javascript

npmnpm
Version
0.8.2
Version published
Weekly downloads
94
754.55%
Maintainers
1
Weekly downloads
 
Created
Source

DEPI NodeJS Client

Generating source files from .proto

Install dependencies:

npm install

# Apple M1 users should install for x64 due to grpc-tools not supporting arm64
npm install --target_arch=x64

Use proto compiler and ts-protoc-gen to generate the TypeScript files:

Important! This needs to be executed from the directory where this file is.

npm run build

To use the async API for the client. Including the following snippet when creating the depi-client instance. These *Async methods are generate in the d.ts by generateAsyncTypes.js which is run as part of the build.

    const { DepiClient } = require('./pbs/depi_grpc_pb');
    const addAsyncMethods = require('./pbs/addAsyncMethods');

    const client = new DepiClient('127.0.0.1:5150', grpc.credentials.createInsecure());
    addAsyncMethods(client);

    // Example using the async/promise methods,
    const req = new depi.LoginRequest();
    const loginResponse = await client.loginAsync(req);

Publish a Release

(Make sure to npm run build and check it's up-to-date).

  • npm run compile
  • Update to a new version (x.x.x) in package.json
  • git commit -am "Node-client release x.x.x"
  • git push origin main
  • npm publish ./

Keywords

depi

FAQs

Package last updated on 28 Feb 2024

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