Catalog npm
Back to packageRELEASE DETAILS

0.0.2

npm

@0xbeejs/requester

Promise based websocket client

Published17 Dec 2024
Direct dependencies17
Transitive dependenciesNot calculated

README

Current package documentation

To communicate with a WebSocket service like an RPC call, avoiding the need to manually match requests and responses in callbacks

Install

$ npm install @0xbeejs/requester
$ yarn add @0xbeejs/requester

Usage

import Requester from "@0xbeejs/requester"

const requeter = new Requester("ws://<YOUR_ENDPOINT>")

interface ReconnectState {
  reconnectAttempts: number;
  requestQueue: number;
  responseQueue: number;
}

const pid = process.pid;
const requester = new Requester(`<endpoint>`, {
    reconnect: {
      auto: true,
      delay: 1000,
      onTimeout: true,
    },
  },
);

requester.currentProvider.on('connect', () => {
  console.log('Connection Established');
});

requester.currentProvider.on('close', () => {
  console.log('Connection Closed');
});

requester.currentProvider.on('reconnect', (data: ReconnectState) => {
  console.log(`Connection reconnect`);
});


async function start() {
    // Asynchronously send message through Websocket and asynchronously retrieve the result
    // The library internally establishes the correspondence between requests and responses
    const data = await requester.send({req: "tx.detail", arg: {txId: "<TX_ID>"}})
    return data
}

start()

Downloads & popularity

4downloads
7-day window · source-reported counts21 Oct 2026
420
2026-10-21: 4 · observed 2026-10-21T11:36:09.8857448Z
21 Oct21 Oct

npm · 1 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2142026-10-21T11:36:09.8857448Z

Declared dependencies 17

Native requirements
17 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
cross-fetch
Environment
{
  "local_name": "cross-fetch",
  "alias": false,
  "peer_metadata": null
}
^4.0.0runtime
eventemitter3
Environment
{
  "local_name": "eventemitter3",
  "alias": false,
  "peer_metadata": null
}
^5.0.0runtime
node-fetch
Environment
{
  "local_name": "node-fetch",
  "alias": false,
  "peer_metadata": null
}
^3.3.2runtime
@0xbeejs/errors
Environment
{
  "local_name": "@0xbeejs/errors",
  "alias": false,
  "peer_metadata": null
}
*runtime
qs
Environment
{
  "local_name": "qs",
  "alias": false,
  "peer_metadata": null
}
^6.11.2runtime
websocket
Environment
{
  "local_name": "websocket",
  "alias": false,
  "peer_metadata": null
}
^1.0.34runtime
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^8.15.0development
@0xbeejs/eslint-config
Environment
{
  "local_name": "@0xbeejs/eslint-config",
  "alias": false,
  "peer_metadata": null
}
*development
nodemon
Environment
{
  "local_name": "nodemon",
  "alias": false,
  "peer_metadata": null
}
^2.0.19development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.9.1development
tsc-alias
Environment
{
  "local_name": "tsc-alias",
  "alias": false,
  "peer_metadata": null
}
^1.7.0development
tsconfig-paths
Environment
{
  "local_name": "tsconfig-paths",
  "alias": false,
  "peer_metadata": null
}
^4.0.0development
tsup
Environment
{
  "local_name": "tsup",
  "alias": false,
  "peer_metadata": null
}
^5.10.1development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.5.3development
@0xbeejs/tsconfig
Environment
{
  "local_name": "@0xbeejs/tsconfig",
  "alias": false,
  "peer_metadata": null
}
*development
@types/qs
Environment
{
  "local_name": "@types/qs",
  "alias": false,
  "peer_metadata": null
}
^6.9.7development
@types/websocket
Environment
{
  "local_name": "@types/websocket",
  "alias": false,
  "peer_metadata": null
}
^1.0.5development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-bxhtuLJk1Lq5cbwac5USHmV7OI5kpPAqmLEWASddThvzhPX8i7vbm3kmeE3F+GN8c8Y0iObFiUeCVYUC2d/CIQ==",
  "shasum": "9965714b72c3efeb39e5e307ac3157859a67dba1",
  "tarball": "https://registry.npmjs.org/@0xbeejs/requester/-/requester-0.0.2.tgz",
  "fileCount": 6,
  "unpackedSize": 169497,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDXh0YcsrS4QmB0cXC8TsVS8/krpgizNYuIPF51DxShSwIhAL1NK8zY2bYGUzyanTFKAxIneAlvya2GUPSLQ5IktxxO"
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:42 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:37bbe9e6ece0ce2d0f74678b66553cd7d09f088ec4f32fb55836c21b78da3131

Other collected versions

0.0.117 DecView all collected versions →