🐑 Commons Host

Documentation

Bulldohzer

API

Table of Contents

Installation

$ npm install bulldohzer

bulldohzer(resolvers, options)

This is a generator function used to asynchronously iterate over the measurements as they are received.

resolvers is an array of objects with either a dns or doh property of the resolver's IP or URL respectively.

options are described in the CLI documentation.

Each yielded value contains the results of a single resolver:

const { bulldohzer } = require('bulldohzer')

const resolvers = [
  { dns: '8.8.8.8' },
  { dns: '9.9.9.9' },
  { doh: 'https://commons.host', name: 'Commons Host' },
  { doh: 'https://dns.quad9.net/dns-query' }
]

const options = {
  percentiles: [50, 99]
}

for await (const result of bulldohzer(resolvers, options)) {
  console.log(result)
  // {
  //   name: 'Commons Host',
  //   service: 'https://commons.host',
  //   protocol: 'doh',
  //   pass: 10,
  //   fail: 0,
  //   percentiles: {
  //     50: 6.48932421049,
  //     99: 9.00561249847
  //   }
  // }
}