pear-electron 1.0.4 → 1.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.
- package/bin.js +4 -5
- package/package.json +1 -2
package/bin.js
CHANGED
|
@@ -14,19 +14,18 @@ const { encode } = require('hypercore-id-encoding')
|
|
|
14
14
|
const { PLATFORM_LOCK, SOCKET_PATH, CONNECT_TIMEOUT } = require('pear-api/constants')
|
|
15
15
|
const tryboot = require('pear-api/tryboot')
|
|
16
16
|
const link = require('pear-link')()
|
|
17
|
-
const byteSize = require('
|
|
18
|
-
const { outputter, ansi } = require('pear-api/terminal')
|
|
17
|
+
const { outputter, ansi, byteSize } = require('pear-api/terminal')
|
|
19
18
|
|
|
20
19
|
const output = outputter('dump', {
|
|
21
20
|
dumping: ({ link, dir, list }) => list > -1 ? '' : `\n${ansi.pear} Bootstrapping pear-electron runtimes from peers\n\nfrom: ${link}\ninto: ${dir}\n`,
|
|
22
21
|
file: ({ key, value }) => `${key}${value ? '\n' + value : ''}`,
|
|
23
22
|
complete: () => '\x1b[1A\nBootstrap complete\n',
|
|
24
23
|
stats ({ upload, download, peers }) {
|
|
25
|
-
const dl = download.total + download.speed === 0 ? '' : `[⬇ ${byteSize(download.total)} - ${byteSize(download.speed)}/s ]`
|
|
26
|
-
const ul = upload.total + upload.speed === 0 ? '' : `[⬆ ${byteSize(upload.total)} - ${byteSize(upload.speed)}/s ]`
|
|
24
|
+
const dl = download.total + download.speed === 0 ? '' : `[⬇ ${byteSize(download.total)} - ${byteSize(download.speed)}/s ] `
|
|
25
|
+
const ul = upload.total + upload.speed === 0 ? '' : `[⬆ ${byteSize(upload.total)} - ${byteSize(upload.speed)}/s ] `
|
|
27
26
|
return {
|
|
28
27
|
output: 'status',
|
|
29
|
-
message: `${dl}
|
|
28
|
+
message: `${dl}${ul}[ Peers: ${peers} ]`
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
error: (err) => `Bootstrap Failure (code: ${err.code || 'none'}) ${err.stack}`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pear-electron",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Pear User-Interface Library for Electron",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": "bin.js",
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
"safety-catch": "^1.0.2",
|
|
90
90
|
"script-linker": "^2.5.3",
|
|
91
91
|
"streamx": "^2.20.2",
|
|
92
|
-
"tiny-byte-size": "^1.1.0",
|
|
93
92
|
"url-file-url": "^1.0.4",
|
|
94
93
|
"which-runtime": "^1.2.1"
|
|
95
94
|
},
|