npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openflam/dnsspatialdiscovery

v4.5.0

Published

Using the DNS to discovery localization servers based on location

Downloads

12

Readme

Javascript DNS spatial discovery

Installation

The npm package is now hosted on npmjs.

npm install @openflam/dnsspatialdiscovery

Usage

Discovery

And then the library can be use in javascript as:

const suffix = "loc." // Suffix to the discovered geodomains
const rootNameserver = "https://loc-nameserver.net"; // By default, Google's DNS server is used (https://dns.google/resolve)
const discoveryObj = new dnsspatialdiscovery.MapsDiscovery(suffix, rootNameserver);

let localizationType = "image";
// Get lat, lon, error_m, vioPose, dataBlob
let circleGeometry = {
    type: 'Circle',
    coordinates: [lon, lat],
    radius: error_m
};
var localizationResult = discoveryObj.localize(
    circleGeometry,
    dataBlob, localizationType, vioPose);

The localize function:

  • Disocvers map servers if they have not been discovered yet.
  • Uses the currently "active server" -- The server that has been giving good localization result to localize.
  • If the active server gives results with a high error, tries to relocalize within the list of discovered servers.
  • If best localization result provided all the discovered is high, rediscovered servers and relocalizes.
  • If no servers are discovered, returns null.

No discovery

You might want to skip disocvery phase if you already know which map server to use. In that case:

let mapServer = new dnsspatialdiscovery.MapServer("map-server.com");
let emptyBlob = new Blob([image]);
let poseData = await mapServer.localize(emptyBlob, "image");

Events

Following events are raised by dnsspatialdiscovery.Events object:

  • "mapfound:good": A map with an error lower than the cofigured bound is found.
  • "mapfound:poor": A map is found, but even the best of the discovered maps in the area has a high error.
  • "nomap": No map found.

Functions can be attached to events as:

dnsspatialdiscovery.Events.on('mapfound:good', () => {
    // Make location marker green
});
dnsspatialdiscovery.Events.on('mapfound:poor', () => {
    // Make location marker yellow
});

Development

Set up npm, and Node.js using nvm using instruction here.

To install dependencies: npm install and to build npm run build.

Testing

Run tests using: npm run test. It'll start a server at http://localhost:9000. Navigate to /test/test.html to view the rest results.