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

dewdrops

v1.0.2

Published

Shortest path between any two nodes in any connected graph. BFS and Dijkstra. Zero dependencies.

Readme

dewdrops

Shortest path between any two nodes in any connected graph. BFS and Dijkstra. Zero dependencies.

npm install dewdrops

What it dews

dewdrops is an overlay, not a database. You bring the data. dewdrops brings the topology.

Point it at any flat data structure with nodes and relationships — a skill tree, a supply chain, a hospital floor plan, a freight network — and dewdrops superimposes a weighted graph on top of it. Your data stays your data. dewdrops is the lens.


Usage

import { TreeTopologyHeuristics, TreeNode } from 'dewdrops'

const graph: Record<string, TreeNode> = {
  a: { id: 'a', connections: ['b', 'c'], weights: { b: 1, c: 4 } },
  b: { id: 'b', connections: ['d'], weights: { d: 2 } },
  c: { id: 'c', connections: ['d'], weights: { d: 1 } },
  d: { id: 'd', connections: [], weights: {} },
}

// Weighted shortest path (Dijkstra)
const result = TreeTopologyHeuristics.findPath(graph, 'a', 'd')
console.log(result.path)     // ['a', 'c', 'd']
console.log(result.distance) // 5

// Nearest node from a set of candidates
const nearest = TreeTopologyHeuristics.findNearest(graph, 'a', ['c', 'd'])
console.log(nearest.targetId) // 'c'
console.log(nearest.distance) // 4

API

TreeNode

interface TreeNode {
  id: string
  connections: string[]
  weights: Record<string, number>
}

PathResult

interface PathResult {
  distance: number  // -1 if unreachable
  path: string[]    // empty if unreachable
}

NearestResult

interface NearestResult {
  targetId: string
  distance: number
  path: string[]
}

TreeTopologyHeuristics.findPath(graph, start, target)

Finds the shortest path between two nodes. Auto-selects BFS (unweighted) or Dijkstra (weighted) based on the graph. Returns PathResult with distance: -1 if unreachable.

TreeTopologyHeuristics.findNearest(graph, start, candidates)

Finds the closest node from a list of candidates. Returns NearestResult.

TreeTopologyHeuristics.calculateGraphDistance(graph, start, target)

Returns the shortest distance as a float. Returns -1 if unreachable.


The two layers

dewdrops always works on two layers:

  1. Your flat data — the source of truth. JSON, a database, a game export, whatever you have.
  2. The graph — what dewdrops builds from it. Nodes, edges, weights.

dewdrops reads both. The flat data is never discarded — it's the context the graph lives on top of. When you apply constraints or query paths, you're querying the overlay, not replacing the source.


Zero dependencies

No runtime dependencies. BFS and Dijkstra implemented from scratch. Works in Node, browsers, and any TypeScript environment.


Part of Dew

dewdrops is the TypeScript distro of Dew — intent-driven graph routing for any connected system.

"What do you need it to dew?"