@johnhenry/browsermesh-discovery 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,7 +1,18 @@
1
1
  # browsermesh-discovery
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/%40johnhenry%2Fbrowsermesh-discovery.svg)](https://www.npmjs.com/package/@johnhenry/browsermesh-discovery)
4
+ [![license](https://img.shields.io/npm/l/%40johnhenry%2Fbrowsermesh-discovery.svg)](LICENSE)
5
+
3
6
  DHT, peer discovery, naming, swarm coordination, and stealth networking for BrowserMesh.
4
7
 
8
+ ## Why this exists
9
+
10
+ Identity (`browsermesh-primitives`/`browsermesh-core`) answers "who is this peer," but a mesh also needs to answer "which peers exist, and how do I find one I haven't talked to yet." That's a genuinely different problem -- Kademlia-style routing tables, gossip, service directories, name resolution, swarm membership/leader-election -- and bundling it into `browsermesh-core` would force every identity-only consumer to pull in DHT/swarm machinery it doesn't need. `browsermesh-discovery` exists as that separate layer: `DhtNode`/`RoutingTable`/`GossipProtocol` for peer-to-peer lookup, `DiscoveryManager`/`DiscoveryStrategy` for pluggable discovery mechanisms (including DHT-backed bootstrap), `MeshNameResolver` for human-readable naming, and `SwarmCoordinator`/`SwimMembership` for group membership and coordination. It depends only on `browsermesh-primitives`, for the shared `MESH_TYPE` message-type constants its DHT and swarm messages are tagged with.
11
+
12
+ ## Used by
13
+
14
+ `@johnhenry/browsermesh-apps` treats this package as an optional peer: `mesh-bootstrap.mjs` lazily `import()`s it to wire a real DHT-backed discovery strategy into `createMeshNode()` (`mesh-dht.mjs`), and `serverless-fetch.mjs`'s `MeshFetchRouter` reuses this package's `parseMeshRequest()` directly to route `mesh://` URLs. Neither is a hard requirement -- `createMeshNode()` works with no discovery strategy at all, or with a caller-supplied one.
15
+
5
16
  ## Provenance
6
17
 
7
18
  Extracted from the private `clawser` monorepo (previously `packages/browsermesh-discovery`), where it was manually published to npm, unscoped, as `browsermesh-discovery@0.1.0` (2026-07-17) with no CI ever automating that publish. This is its first release as part of the `@johnhenry/browsermesh` monorepo; the version restarts at `0.0.0` per family convention.
@@ -27,7 +38,7 @@ npm install @johnhenry/browsermesh-discovery @johnhenry/browsermesh-primitives
27
38
  ## Usage
28
39
 
29
40
  ```js
30
- import { DhtNode, DiscoveryManager, SwarmCoordinator } from 'browsermesh-discovery';
41
+ import { DhtNode, DiscoveryManager, SwarmCoordinator } from '@johnhenry/browsermesh-discovery';
31
42
  ```
32
43
 
33
44
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnhenry/browsermesh-discovery",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "DHT, peer discovery, naming, swarm coordination, and stealth networking for BrowserMesh",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",
@@ -19,13 +19,13 @@
19
19
  "directory": "packages/browsermesh-discovery"
20
20
  },
21
21
  "peerDependencies": {
22
- "@johnhenry/browsermesh-primitives": ">=0.0.1 <1.0.0"
22
+ "@johnhenry/browsermesh-primitives": ">=0.2.0 <1.0.0"
23
23
  },
24
24
  "scripts": {
25
25
  "test": "node --import ./test/_setup-globals.mjs --test test/*.test.mjs"
26
26
  },
27
27
  "homepage": "https://opensource.johnhenry.me/browsermesh/",
28
28
  "engines": {
29
- "node": ">=24.0.0"
29
+ "node": ">=26.0.0"
30
30
  }
31
31
  }