@thermocline-labs/whats-miner

1.0.4 • Public • Published

whats-miner

Client library for WhatsMiner JSON over TCP API.

npm install @thermocline-labs/whats-miner

Usage

The client instance exposes a promise based interface for communicating with the WhatsMiner JSON over TCP API. All the methods also accept an optional abort signal used to abort pending requests.

const { WhatsMiner, ResponseError } = require('@thermocline-labs/whats-miner')

const client = WhatsMiner('localhost', 4028)

try {
  const abortController = new AbortController()
  const summary = await client.summary(abortController.signal)

  console.log(summary)
} catch (err) {
  if (err instanceof ResponseError) {
    // Handle response error
    return
  }

  throw err
}

Readme

Keywords

Package Sidebar

Install

npm i @thermocline-labs/whats-miner

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

3.96 kB

Total Files

4

Last publish

Collaborators

  • kapetan