swarmwire-cli 0.0.1 → 0.2.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tibotibotibotibotibotibotibotibotibotibotibo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,8 +1,61 @@
1
- # Swarmwire-cli
1
+ # swarmwire-cli
2
2
 
3
- placeholder for the swarmwire CLI repo.
3
+ Send a file or a folder to someone with a link. Peer to peer, from the terminal: no account, no
4
+ server, no upload. Built on [`swarmwire-lib`](https://github.com/tibocub/swarmwire).
4
5
 
6
+ ```
7
+ npm i -g swarmwire-cli
5
8
 
6
- # Liscence
9
+ swarmwire send ./holiday-photos # prints a link, keeps serving until you press ctrl-c
10
+ swarmwire get "<link>" # on the other machine: downloads it, resumable
11
+ ```
7
12
 
8
- MIT
13
+ Generate QR codes for easy use with the [swarmwire android app](https://github.com/tibocub/swarmwire-mobile)
14
+ ```
15
+ swarmwire send ./holiday-photos --qr # also prints a QR code to flash from the android app
16
+ swarmwire get --qr # displays a QR code that can be flashed to send a file from the android app
17
+ ```
18
+
19
+ Anyone who knows what a file contains can find the people sharing it, whatever each calls it: two
20
+ people sending the same file are one swarm. Pass `--private` to `send` for a link that carries a secret, so that only people
21
+ holding the link can find you.
22
+
23
+ Both commands keep a two-line status current. Receiving looks like this:
24
+
25
+ ```
26
+ [=========> ] 45% [2/3] TOTAL: [154.2/344.0] MB
27
+ UP: 1.1 MB/s DOWN: 8.2 MB/s Seeders: 1 Peers: 0
28
+ ```
29
+
30
+ When the download is done the bar is replaced by `[Done] you are now seeding.` and `get` keeps
31
+ running so others can fetch from you; ctrl-c stops it, `--exit` leaves as soon as it is done.
32
+ Sending shows `[Seeding]` in place of the bar.
33
+
34
+ *Seeders* are the peers connected to you that hold all of it, *Peers* the other ones. They are
35
+ your direct connections only, never counting yourself and not the whole swarm. Someone who
36
+ vanishes without saying goodbye (a pulled cable) drops off after the connection times out, about
37
+ fifteen seconds. The speeds are bytes on the wire, so a little above the size of the data. Sizes
38
+ are decimal: 1 MB is 1,000,000 bytes.
39
+
40
+ ## Options
41
+
42
+ | | |
43
+ |---|---|
44
+ | `send <path> [--private] [--qr]` | share a file or folder; prints a link (`--qr`: also draws it as a QR code) |
45
+ | `get --qr [output] [--exit]` | draw a QR code and wait: a phone scans it and hands over a link (its own file, or one forwarded from another device) |
46
+ | `get <link> [output] [--exit]` | fetch by link, then keep seeding it (`--exit`: leave instead); the output defaults to the name in the link |
47
+ | `--bootstrap host:port` | use a private DHT instead of the public one (for tests) |
48
+
49
+ `get --qr` listens on a fresh one-shot key on the DHT, shown in the QR code and printed below it as
50
+ `swarmwire-recv://<key>`. It takes the first valid link anyone sends it, then downloads as usual.
51
+ The QR codes go to stderr, so `send`'s stdout is still just the link.
52
+
53
+ Needs Node 20 or later. Files are shared where they lie: nothing is copied or written next to them.
54
+
55
+ ## Development
56
+
57
+ ```
58
+ npm test # real processes over a private DHT, no internet needed
59
+ ```
60
+
61
+ MIT.
@@ -0,0 +1,343 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * swarmwire send <path> [--private] [--qr] [--bootstrap host:port]
4
+ * swarmwire get <link> [output] [--bootstrap host:port]
5
+ * swarmwire get --qr [output] [--bootstrap host:port]
6
+ *
7
+ * Deliberately two commands. Sending prints a link and keeps serving the file where it is;
8
+ * getting takes that link and nothing else.
9
+ */
10
+
11
+ import { randomBytes } from 'crypto'
12
+ import { stat } from 'fs/promises'
13
+ import Hyperswarm from 'hyperswarm'
14
+ import DHT from 'hyperdht'
15
+ import b4a from 'b4a'
16
+ import { renderQr } from '../lib/qr.js'
17
+ import { receive } from '../lib/rendezvous.js'
18
+ import { Swarmwire, parseLink, groupLength, DEFAULT_GROUP_LOG } from 'swarmwire-lib'
19
+
20
+ const USAGE = `swarmwire - content-addressed file transfer, peer to peer
21
+
22
+ swarmwire send <path> [options] share a file or folder; prints a link
23
+ swarmwire get <link> [output] fetch a file or folder by link
24
+ swarmwire get --qr [output] show a QR code; a phone scans it and hands over a link
25
+
26
+ Options:
27
+ --private only people holding the link can find you (default: anyone who knows the hash can)
28
+ --qr send: also show the link as a QR code. get: wait for a link from a scanner
29
+ --exit get: leave when the download is done instead of seeding it
30
+ --bootstrap <h:p> use a private DHT instead of the public one
31
+ --help
32
+ `
33
+
34
+ // A terminal gets a two-line status rewritten in place. Anything else gets a line only when
35
+ // who is connected changes: speeds and a bar would be a new line every half second.
36
+ let shown = ''
37
+ let drawn = false
38
+ let lastPlain = ''
39
+
40
+ const FLAGS = { private: false, exit: false, qr: false, help: false, bootstrap: true } // true: takes a value
41
+
42
+ async function main () {
43
+ const { command, args, flags } = parseArgs(process.argv.slice(2))
44
+
45
+ if (flags.help || !command) return print(USAGE)
46
+ if (command === 'send') return send(args[0], flags)
47
+ if (command === 'get') return flags.qr ? get(null, args[0], flags) : get(args[0], args[1], flags)
48
+
49
+ throw new Error(`unknown command: ${command}\n\n${USAGE}`)
50
+ }
51
+
52
+ async function send (path, flags) {
53
+ if (!path) throw new Error('send needs a path\n\n' + USAGE)
54
+
55
+ const swarm = createSwarm(flags)
56
+ const node = new Swarmwire({ swarm })
57
+
58
+ // A private link carries its own secret, so only people holding it can find you.
59
+ const secret = flags.private ? randomBytes(32).toString('hex') : null
60
+ const folder = await isDirectory(path)
61
+
62
+ const { link, size, files } = folder
63
+ ? await node.serveCollection(path, { secret })
64
+ : await node.serve(path, { secret })
65
+
66
+ print(link)
67
+ if (flags.qr) warn(renderQr(link, { color: process.stderr.isTTY }))
68
+ warn(
69
+ folder
70
+ ? `serving ${path} (${files} files, ${bytes(size)})${flags.private ? ' privately' : ''}`
71
+ : `serving ${path} (${bytes(size)})${flags.private ? ' privately' : ''}`
72
+ )
73
+ warn('keep this running; ctrl-c to stop')
74
+
75
+ const poll = watch(node, swarm, link, () => '[Seeding]')
76
+
77
+ await interrupted()
78
+
79
+ clearInterval(poll)
80
+ warn('stopping')
81
+ await node.destroy()
82
+ await swarm.destroy()
83
+ }
84
+
85
+ async function get (link, output, flags) {
86
+ if (!link && !flags.qr) throw new Error('get needs a link\n\n' + USAGE)
87
+
88
+ const swarm = createSwarm(flags)
89
+
90
+ if (!link) {
91
+ link = await linkFromScanner(swarm)
92
+ if (!link) return swarm.destroy() // interrupted while waiting
93
+ }
94
+
95
+ const parsed = parseLink(link)
96
+ const out = output ?? safeName(parsed.name) ?? parsed.root.slice(0, 16)
97
+
98
+ const node = new Swarmwire({ swarm })
99
+
100
+ warn(`fetching ${parsed.root.slice(0, 16)}... into ${out}`)
101
+
102
+ // What the status line shows of the transfer: bytes of the whole thing, and which file.
103
+ const progress = { done: 0, total: parsed.size, file: 0, files: 0, finished: false }
104
+ let download = null
105
+
106
+ const poll = watch(node, swarm, parsed, () => {
107
+ if (progress.finished) return '[Done] you are now seeding.'
108
+ if (download) progress.done = Math.min(download.have * groupLength(DEFAULT_GROUP_LOG), parsed.size)
109
+
110
+ const counter = progress.files > 1 ? ` [${Math.min(progress.file + 1, progress.files)}/${progress.files}]` : ''
111
+ return `${bar(progress.done / progress.total)} ${Math.floor((progress.done / progress.total) * 100)}%${counter} TOTAL: ${pair(progress.done, progress.total)}`
112
+ })
113
+
114
+ const work = (async () => {
115
+ if (parsed.type === 'collection') {
116
+ const list = await node.readList(parsed)
117
+ warn(`${list.files.length} files, ${bytes(list.size)}`)
118
+ progress.files = list.files.length
119
+
120
+ await node.downloadCollection(parsed, out, {
121
+ onfile: () => { progress.file++ },
122
+ onprogress: ({ bytes, total }) => Object.assign(progress, { done: bytes, total })
123
+ })
124
+
125
+ } else {
126
+ download = node.download(parsed, out)
127
+ await download
128
+ }
129
+ })()
130
+
131
+ const stopped = await Promise.race([work.then(() => false), interrupted().then(() => true)])
132
+
133
+ if (!stopped) {
134
+ progress.finished = true
135
+ if (!process.stderr.isTTY) warn(flags.exit ? '[Done]' : '[Done] you are now seeding.')
136
+ clearStatus() // the path goes below nothing: printed inside the status, the next redraw leaves its old bar behind
137
+ print(out)
138
+
139
+ if (!flags.exit) await interrupted()
140
+ }
141
+
142
+ clearInterval(poll)
143
+ warn('stopping')
144
+ await node.destroy()
145
+ await swarm.destroy()
146
+ }
147
+
148
+ /** Show a QR code for a one-shot meeting point and wait for a scanner to hand us a link. */
149
+ async function linkFromScanner (swarm) {
150
+ const meeting = await receive(swarm.dht)
151
+
152
+ warn(renderQr(meeting.url, { color: process.stderr.isTTY }))
153
+ warn(`${meeting.url}\nscan this with the swarmwire app and pick something to send; ctrl-c to cancel`)
154
+
155
+ const link = await Promise.race([meeting.link, interrupted().then(() => null)])
156
+ await meeting.close()
157
+
158
+ return link
159
+ }
160
+
161
+ /** Resolves on ctrl-c or a polite kill, so serving can end cleanly. */
162
+ function interrupted () {
163
+ return new Promise((resolve) => {
164
+ process.once('SIGINT', resolve)
165
+ process.once('SIGTERM', resolve)
166
+ })
167
+ }
168
+
169
+ /**
170
+ * Keep the status current: `lead()` is the first line, then speeds and who is connected.
171
+ * Peers are everyone connected who does not hold all of it; seeders are counted apart.
172
+ */
173
+ function watch (node, swarm, link, lead) {
174
+ const meter = new Meter(swarm)
175
+
176
+ const show = () => {
177
+ const { peers, seeders } = node.counts(link)
178
+ const people = `Seeders: ${seeders} Peers: ${peers - seeders}`
179
+ const { up, down } = meter.rates()
180
+
181
+ status(lead(), `UP: ${rate(up)} DOWN: ${rate(down)} ${people}`, people)
182
+ }
183
+
184
+ node.on('peer-connected', show)
185
+ node.on('peer-disconnected', show)
186
+ show()
187
+
188
+ return setInterval(show, 500) // a peer finishing, or progress, is not a connection event
189
+ }
190
+
191
+ /** Bytes on the wire in each direction, summed over every connection, past and present. */
192
+ class Meter {
193
+ constructor (swarm) {
194
+ this.closed = { up: 0, down: 0 }
195
+ this.live = new Set()
196
+ this.samples = [] // recent { at, up, down }, for a rate smoothed over a couple of seconds
197
+
198
+ swarm.on('connection', (stream) => {
199
+ this.live.add(stream)
200
+ stream.once('close', () => {
201
+ this.live.delete(stream)
202
+ this.closed.up += stream.rawBytesWritten
203
+ this.closed.down += stream.rawBytesRead
204
+ })
205
+ })
206
+ }
207
+
208
+ rates () {
209
+ let { up, down } = this.closed
210
+ for (const stream of this.live) {
211
+ up += stream.rawBytesWritten
212
+ down += stream.rawBytesRead
213
+ }
214
+
215
+ const now = Date.now()
216
+ this.samples.push({ at: now, up, down })
217
+ while (this.samples.length > 5) this.samples.shift()
218
+
219
+ const first = this.samples[0]
220
+ const seconds = (now - first.at) / 1000
221
+ return seconds > 0 ? { up: (up - first.up) / seconds, down: (down - first.down) / seconds } : { up: 0, down: 0 }
222
+ }
223
+ }
224
+
225
+ function createSwarm ({ bootstrap }) {
226
+ if (!bootstrap) return new Hyperswarm()
227
+
228
+ const [host, port] = String(bootstrap).split(':')
229
+ const loopback = host === '127.0.0.1' || host === 'localhost'
230
+
231
+ const dht = new DHT({
232
+ bootstrap: [{ host, port: Number(port) }],
233
+ ephemeral: false,
234
+ firewalled: false,
235
+ // On a loopback DHT, bind there too: announcing a LAN address to peers that can only
236
+ // reach 127.0.0.1 leaves everyone findable and nobody connectable.
237
+ host: loopback ? '127.0.0.1' : undefined
238
+ })
239
+
240
+ return new Hyperswarm({ dht })
241
+ }
242
+
243
+ async function isDirectory (path) {
244
+ const info = await stat(path).catch(() => null)
245
+ if (info === null) throw new Error(`no such file or folder: ${path}`)
246
+
247
+ return info.isDirectory()
248
+ }
249
+
250
+ /** A filename hint is a hint: never let it climb out of the working directory. */
251
+ function safeName (name) {
252
+ if (!name) return null
253
+
254
+ const base = name.split(/[\\/]/).pop()
255
+ return base && base !== '.' && base !== '..' ? base : null
256
+ }
257
+
258
+ function parseArgs (argv) {
259
+ const args = []
260
+ const flags = {}
261
+ let command = null
262
+
263
+ for (let i = 0; i < argv.length; i++) {
264
+ const arg = argv[i]
265
+
266
+ if (!arg.startsWith('--')) {
267
+ if (command === null) command = arg
268
+ else args.push(arg)
269
+ continue
270
+ }
271
+
272
+ const [key, inline] = arg.slice(2).split('=')
273
+ if (!(key in FLAGS)) throw new Error(`unknown option: --${key}\n\n${USAGE}`)
274
+
275
+ flags[key] = FLAGS[key] ? (inline ?? argv[++i]) : true
276
+ if (flags[key] === undefined) throw new Error(`--${key} needs a value`)
277
+ }
278
+
279
+ return { command, args, flags }
280
+ }
281
+
282
+ const UNITS = ['B', 'KB', 'MB', 'GB', 'TB']
283
+
284
+ /** The unit that keeps a size readable: 1 or more, below 1000. */
285
+ function unitOf (n) {
286
+ return Math.min(Math.max(Math.floor(Math.log10(Math.max(n, 1)) / 3), 0), UNITS.length - 1)
287
+ }
288
+
289
+ function scaled (n, unit) {
290
+ return unit === 0 ? String(Math.round(n)) : (n / 1000 ** unit).toFixed(1)
291
+ }
292
+
293
+ function bytes (n) {
294
+ const unit = unitOf(n)
295
+ return `${scaled(n, unit)} ${UNITS[unit]}`
296
+ }
297
+
298
+ /** Progress in the unit of the total: "[254.0/344.0] MB". */
299
+ function pair (done, total) {
300
+ const unit = unitOf(total)
301
+ return `[${scaled(done, unit)}/${scaled(total, unit)}] ${UNITS[unit]}`
302
+ }
303
+
304
+ function rate (perSecond) {
305
+ return `${bytes(perSecond)}/s`
306
+ }
307
+
308
+ function bar (fraction, width = 20) {
309
+ const filled = Math.min(width, Math.max(0, Math.floor(fraction * width)))
310
+ return '[' + '='.repeat(filled) + (filled < width ? '>' : '') + ' '.repeat(Math.max(0, width - filled - 1)) + ']'
311
+ }
312
+
313
+ function print (line) {
314
+ console.log(line)
315
+ }
316
+
317
+ function status (lead, detail, plain) {
318
+ const text = lead + '\n' + detail
319
+ if (text === shown) return
320
+ shown = text
321
+
322
+ if (!process.stderr.isTTY) return plain === lastPlain ? undefined : console.error((lastPlain = plain))
323
+
324
+ process.stderr.write((drawn ? '\x1b[2A' : '') + `\r\x1b[K${lead}\n\x1b[K${detail}\n`)
325
+ drawn = true
326
+ }
327
+
328
+ /** Erase the status so a line can be printed where it was; the next redraw starts below it. */
329
+ function clearStatus () {
330
+ if (process.stderr.isTTY && drawn) process.stderr.write('\r\x1b[2A\x1b[J')
331
+ drawn = false
332
+ shown = ''
333
+ }
334
+
335
+ function warn (line) {
336
+ clearStatus()
337
+ console.error(line)
338
+ }
339
+
340
+ main().catch((err) => {
341
+ warn(String(err.message ?? err))
342
+ process.exit(1)
343
+ })
package/lib/qr.js ADDED
@@ -0,0 +1,25 @@
1
+ import { encode } from 'uqr'
2
+
3
+ const QUIET = 2 // modules of white around the code, as the spec asks
4
+
5
+ /**
6
+ * A QR code as terminal text, two modules per character row. Black on white is set
7
+ * explicitly when `color` is true: on a dark theme the default colors would invert the code.
8
+ */
9
+ export function renderQr (text, { color = true } = {}) {
10
+ const { data, size } = encode(text, { ecc: 'L', border: 0 })
11
+ const dark = (x, y) => x >= 0 && y >= 0 && x < size && y < size && data[y][x]
12
+
13
+ const rows = []
14
+ for (let y = -QUIET; y < size + QUIET; y += 2) {
15
+ let row = ''
16
+ for (let x = -QUIET; x < size + QUIET; x++) {
17
+ const top = dark(x, y)
18
+ const bottom = dark(x, y + 1)
19
+ row += top && bottom ? '█' : top ? '▀' : bottom ? '▄' : ' '
20
+ }
21
+ rows.push(color ? `\x1b[30;47m${row}\x1b[0m` : row)
22
+ }
23
+
24
+ return rows.join('\n')
25
+ }
@@ -0,0 +1,88 @@
1
+ /**
2
+ * A one-shot meeting point for handing a link to a machine that cannot be reached by one.
3
+ *
4
+ * `receive` listens on a fresh DHT keypair and shows its public key (as a QR code); whoever
5
+ * scans it calls `deliver` with a link, the listener checks it is one and answers. No topic,
6
+ * no discovery: the key is the address, and it is good for exactly one link.
7
+ */
8
+
9
+ import b4a from 'b4a'
10
+ import { parseLink } from 'swarmwire-lib'
11
+
12
+ export const SCHEME = 'swarmwire-recv://'
13
+ const MAX_LINK = 4096 // a link is ~150 bytes; this only bounds what a stranger can make us buffer
14
+
15
+ /**
16
+ * @param {import('hyperdht')} dht
17
+ * @returns {Promise<{url: string, link: Promise<string>, close: () => Promise<void>}>}
18
+ */
19
+ export async function receive (dht) {
20
+ const keyPair = dht.constructor.keyPair()
21
+ let resolve
22
+ const link = new Promise((r) => { resolve = r })
23
+ let done = false
24
+
25
+ const server = dht.createServer((socket) => {
26
+ let buffer = ''
27
+ socket.setEncoding('utf8')
28
+ socket.on('error', () => {}) // a scanner that walks away is not our problem
29
+ socket.on('data', (chunk) => {
30
+ buffer += chunk
31
+ if (buffer.length > MAX_LINK) return socket.destroy()
32
+
33
+ const end = buffer.indexOf('\n')
34
+ if (end < 0) return
35
+
36
+ const candidate = buffer.slice(0, end).trim()
37
+ buffer = ''
38
+
39
+ try {
40
+ if (done) throw new Error('already received')
41
+ parseLink(candidate)
42
+ } catch {
43
+ return socket.end('invalid\n')
44
+ }
45
+
46
+ done = true
47
+ socket.end('ok\n')
48
+ resolve(candidate)
49
+ })
50
+ })
51
+
52
+ await server.listen(keyPair)
53
+
54
+ return {
55
+ url: SCHEME + b4a.toString(keyPair.publicKey, 'hex'),
56
+ link,
57
+ close: () => server.close()
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Hand `link` to the listener at `url`. Resolves once it has accepted it.
63
+ *
64
+ * @param {import('hyperdht')} dht
65
+ * @param {string} url
66
+ * @param {string} link
67
+ */
68
+ export async function deliver (dht, url, link) {
69
+ if (!url.startsWith(SCHEME)) throw new Error(`not a swarmwire receive address: ${url}`)
70
+ const publicKey = b4a.from(url.slice(SCHEME.length), 'hex')
71
+ if (publicKey.length !== 32) throw new Error(`not a swarmwire receive address: ${url}`)
72
+
73
+ const socket = dht.connect(publicKey)
74
+ socket.setEncoding('utf8')
75
+
76
+ const answer = new Promise((resolve, reject) => {
77
+ let reply = ''
78
+ socket.on('data', (chunk) => { reply += chunk })
79
+ socket.on('error', reject)
80
+ socket.on('end', () => { socket.end(); resolve(reply.trim()) }) // the listener half-closes after its answer
81
+ socket.on('close', () => resolve(reply.trim()))
82
+ })
83
+
84
+ socket.write(link + '\n')
85
+ const reply = await answer
86
+
87
+ if (reply !== 'ok') throw new Error(`receiver refused the link${reply ? `: ${reply}` : ''}`)
88
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "swarmwire-cli",
3
- "version": "0.0.1",
4
- "description": "Easy P2P file transfer form the terminal",
3
+ "version": "0.2.0",
4
+ "description": "Send a file or folder to someone with a link. Peer to peer, from the terminal.",
5
5
  "keywords": [
6
6
  "cli",
7
7
  "p2p",
8
- "hyperswarm"
8
+ "hyperswarm",
9
+ "file-transfer"
9
10
  ],
10
11
  "homepage": "https://github.com/tibocub/swarmwire-cli#readme",
11
12
  "bugs": {
@@ -18,8 +19,28 @@
18
19
  "license": "MIT",
19
20
  "author": "tibotibotibo",
20
21
  "type": "module",
21
- "main": "index.js",
22
+ "bin": {
23
+ "swarmwire": "bin/swarmwire.js"
24
+ },
25
+ "files": [
26
+ "bin/",
27
+ "lib/"
28
+ ],
29
+ "engines": {
30
+ "node": ">=20"
31
+ },
22
32
  "scripts": {
23
- "test": "echo \"Error: no test specified\" && exit 1"
33
+ "test": "brittle test/*.test.js"
34
+ },
35
+ "dependencies": {
36
+ "b4a": "^1.9.0",
37
+ "hyperdht": "^6.0.0",
38
+ "hyperswarm": "^4.17.2",
39
+ "swarmwire-lib": "^0.4.1",
40
+ "uqr": "^0.1.3"
41
+ },
42
+ "devDependencies": {
43
+ "@hyperswarm/testnet": "^3.1.4",
44
+ "brittle": "^3.19.1"
24
45
  }
25
46
  }