OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-deploy commits / 7f78c7c

README: the repo had none
Written from the source, not from memory: exports and method names come from index.js and lib/, the usage example mirrors examples/cli.js, and the test count is one I ran. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
7f78c7c946d572d7513236a885acd52f64c85e71
by plankatron <fleeky@gmail.com> · 2026-09-10T15:40:20.000Z

Changed files (1) +74 -0

README.md +74 -0
……@@ -0,0 +1,74 @@
1# hyper-deploy
2
3P2P release distribution — serve build artifacts to peers over Hyperswarm, built on
4[hyper-overlay](../hyper-overlay).
5
6Point it at a directory. It content-hashes what it finds, announces a topic, and serves the
7files to whoever joins. Files ≥ 1 MB are FastCDC-chunked so a transfer resumes rather than
8restarts; smaller files move as whole blobs. Dedup is per-file, by hash.
9
10## Install
11
12```sh
13npm install hyper-deploy
14```
15
16## Usage
17
18```js
19import { DeployServer, DeployClient } from 'hyper-deploy'
20
21// serve a build directory
22const server = new DeployServer('./build')
23await server.ready()
24console.log(server.topic.toString('hex'))
25
26// pull it somewhere else
27const client = new DeployClient(topic)
28await client.ready()
29await client.pull('./out')
30```
31
32## API
33
34#### `new DeployServer(dir, [options])`
35
36`ReadyResource`. Scans `dir` and serves it.
37
38```js
39{
40 topic, // 32 bytes; a random one is generated if omitted
41 swarm, // an existing Hyperswarm; one is created and owned if omitted
42 corestore, // likewise
43 enableTrees // attach hyper-overlay/v2 for tree + content-by-hash requests (default true)
44}
45```
46
47#### `await server.rescan()`
48
49Re-scan the directory. Incremental — unchanged files are not re-hashed.
50
51#### `server.serveOnConnection(conn)`
52
53Serve over a connection you already have, rather than one the swarm handed you. Safe to call
54more than once per connection.
55
56#### `new DeployClient(topic, [options])`
57#### `await client.pull(dir)`
58
59## Test
60
61⚠ `npm test` is **broken**: it runs `brittle`, which is Node, and this package imports
62`bare-fs`. Use the Bare runner:
63
64```sh
65npx brittle-bare test/basic.test.js
66```
67
68Measured: 24 asserts across six files pass (`basic`, `connection-release`,
69`incremental-rescan`, `manifest-boot`, `overlay-map-cache`, `tree-publish`).
70`e2e-release-sync` and `symlink-serve` error out.
71
72## License
73
74Not yet declared.