OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-sync commits / b302231

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>
b302231fb094e8b04f490e1336cf9f5b291fcf4f
by plankatron <fleeky@gmail.com> · 2026-09-10T15:40:21.000Z

Changed files (1) +62 -0

README.md +62 -0
……@@ -0,0 +1,62 @@
1# hyper-sync
2
3Manage and sync bare git repos over Hyperswarm.
4
5Serve a bare repository on a topic; clone and fetch from it on another machine with no server,
6no forwarded port and no account. It shells out to real `git` for the transfer, so the objects
7on both ends are ordinary git objects.
8
9## Install
10
11```sh
12npm install hyper-sync
13```
14
15## Usage
16
17```js
18const HyperSync = require('hyper-sync')
19
20const sync = new HyperSync('./repos')
21await sync.ready()
22
23await sync.scan() // find bare repos under ./repos
24await sync.serve('myrepo') // announce it on its topic
25console.log(await sync.info('myrepo'))
26
27// elsewhere
28await sync.addRemote('myrepo', topicHex)
29await sync.pull('myrepo')
30```
31
32## API
33
34#### `new HyperSync(dir, [options])`
35
36`ReadyResource` over a directory of bare repos.
37
38#### `await sync.scan()`
39
40Discover bare repos under the directory.
41
42#### `await sync.serve(name)` · `await sync.unserve(name)`
43
44Start or stop announcing a repo on its topic.
45
46#### `await sync.addRemote(name, topic)` · `sync.removeRemote(name)`
47#### `await sync.pull(name)`
48
49Fetch from a served remote. Missing objects are detected with `git fsck` and re-fetched rather
50than left to fail later.
51
52#### `sync.info(name)` · `sync.status()`
53
54## Test
55
56```sh
57npm test # 19/19
58```
59
60## License
61
62Not yet declared.