hyperdrive-profiler 1.0.0 → 2.0.1

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 (3) hide show
  1. package/README.md +4 -0
  2. package/bin.js +2 -1
  3. package/package.json +12 -6
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Profile [Hyperdrive](https://github.com/holepunchto/hyperdrive) download performance.
4
4
 
5
+ The current major (v2) works for Hyperdrive v13. The old major (v1) works for Hyperdrive v11.
6
+
5
7
  ## Install
6
8
 
7
9
  ```
@@ -14,6 +16,8 @@ npm i -g hyperdrive-profiler
14
16
  hyperdrive-profiler <drive key>
15
17
  ```
16
18
 
19
+ Note: for running with bare, use `hyperdrive-profiler-bare`,
20
+
17
21
  This downloads the Hyperdrive with the given key to a temporary folder, and displays performance and progress metrics.
18
22
 
19
23
  To see all options, run
package/bin.js CHANGED
@@ -4,6 +4,7 @@ const { once } = require('events')
4
4
  const fs = require('fs')
5
5
  const os = require('os')
6
6
  const path = require('path')
7
+ const { performance } = require('perf_hooks')
7
8
 
8
9
  const { command, arg, flag } = require('paparam')
9
10
  const goodbye = require('graceful-goodbye')
@@ -97,7 +98,7 @@ const cmd = command('hyperdrive-profiler',
97
98
 
98
99
  console.info(`Downloading drive version ${drive.version}`)
99
100
  console.log(`\n${'-'.repeat(50)}\n`)
100
- await drive.download('/', { wait: true })
101
+ await drive.download('/', { wait: true }).done()
101
102
 
102
103
  secTillFullyDownload = (performance.now() - tStart) / 1000
103
104
  cancelling = false
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "hyperdrive-profiler",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Profile hyperdrive download performance",
5
5
  "main": "bin.js",
6
6
  "scripts": {
7
7
  "test": "standard"
8
8
  },
9
9
  "bin": {
10
- "hyperdrive-profiler": "bin.js"
10
+ "hyperdrive-profiler": "bin.js",
11
+ "hyperdrive-profiler-bare": "bare bin.js"
11
12
  },
12
13
  "files": [
13
14
  "bin.js"
@@ -35,13 +36,14 @@
35
36
  "bare-fs": "^4.0.1",
36
37
  "bare-os": "^3.4.0",
37
38
  "bare-path": "^3.0.0",
38
- "corestore": "^6.18.4",
39
+ "bare-performance": "^1.0.1",
40
+ "corestore": "^7.0.0",
39
41
  "graceful-goodbye": "^1.3.3",
40
42
  "hypercore-id-encoding": "^1.3.0",
41
- "hypercore-stats": "^1.3.1",
42
- "hyperdrive": "^11.13.4",
43
+ "hypercore-stats": "^2.1.0",
44
+ "hyperdrive": "^13.0.1",
43
45
  "hyperswarm": "^4.8.4",
44
- "hyperswarm-stats": "^1.1.4",
46
+ "hyperswarm-stats": "^1.2.0",
45
47
  "paparam": "^1.8.0",
46
48
  "tiny-byte-size": "^1.1.0"
47
49
  },
@@ -61,6 +63,10 @@
61
63
  "path": {
62
64
  "bare": "bare-path",
63
65
  "default": "path"
66
+ },
67
+ "perf_hooks": {
68
+ "bare": "bare-performance",
69
+ "default": "perf_hooks"
64
70
  }
65
71
  }
66
72
  }