Socket
Book a DemoInstallSign in
Socket

hyperdht-stats

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperdht-stats

HyperDHT stats, with Prometheus support

latest
Source
npmnpm
Version
1.10.0
Version published
Weekly downloads
293
38.86%
Maintainers
2
Weekly downloads
 
Created
Source

HyperDHT Stats

HyperDHT stats, with Prometheus support.

Install

npm i hyperdht-stats

Example

To use with Prometheus:

const Hyperdht = require('Hyperdht')
const DhtStats = require('hyperdht-stats')
const promClient = require('prom-client')

const dht = new Hyperdht()
const stats = new DhtStats(swarm)

stats.registerPrometheusMetrics(promClient)

// In practice metrics are exposed to a metrics scraper
// over a server, but to illustrate we just print them
const metrics = await promClient.register.metrics()
console.log(metrics)

Usage Without Prometheus

dhtStats.toString() returns a string overview of all stats.

dhtStats.toJson() returns a JSON overview of all stats.

Keywords

hyperdht

FAQs

Package last updated on 08 Oct 2025

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