@microlink/cli 2.0.8 → 2.0.12
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/package.json +3 -3
- package/src/cli.js +0 -2
- package/src/print.js +4 -6
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@microlink/cli",
|
|
3
3
|
"description": "Interacting with Microlink API from your terminal.",
|
|
4
4
|
"homepage": "https://nicedoc.io/microlinkhq/cli",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.12",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"microlink": "bin/microlink"
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"got": "~11.8.3",
|
|
38
38
|
"jsome": "~2.5.0",
|
|
39
39
|
"meow": "~9.0.0",
|
|
40
|
-
"
|
|
41
|
-
"picocolors": "~
|
|
40
|
+
"ora": "~5.4.0",
|
|
41
|
+
"picocolors": "~0.2.1",
|
|
42
42
|
"pretty-bytes": "~5.6.0",
|
|
43
43
|
"pretty-ms": "~7.0.1",
|
|
44
44
|
"temperment": "~1.0.0",
|
package/src/cli.js
CHANGED
package/src/print.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { createSpinner } = require('nanospinner')
|
|
4
3
|
const terminalLink = require('terminal-link')
|
|
5
4
|
const prettyBytes = require('pretty-bytes')
|
|
6
5
|
const prettyMs = require('pretty-ms')
|
|
7
6
|
const colors = require('picocolors')
|
|
8
7
|
const termImg = require('term-img')
|
|
9
8
|
const jsome = require('jsome')
|
|
9
|
+
const ora = require('ora')
|
|
10
10
|
|
|
11
11
|
jsome.colors = {
|
|
12
12
|
num: 'cyan',
|
|
@@ -23,7 +23,7 @@ jsome.colors = {
|
|
|
23
23
|
|
|
24
24
|
module.exports = {
|
|
25
25
|
spinner: (text = '') => {
|
|
26
|
-
const spinner =
|
|
26
|
+
const spinner = ora({ color: 'white', text })
|
|
27
27
|
const now = Date.now()
|
|
28
28
|
const elapsedTime = () => Date.now() - now
|
|
29
29
|
let interval
|
|
@@ -31,15 +31,13 @@ module.exports = {
|
|
|
31
31
|
const start = () => {
|
|
32
32
|
interval = setInterval(() => {
|
|
33
33
|
const duration = elapsedTime()
|
|
34
|
-
if (duration > 500) {
|
|
35
|
-
spinner.update({ text: `${prettyMs(duration)} ${text}` })
|
|
36
|
-
}
|
|
34
|
+
if (duration > 500) spinner.text = `${prettyMs(duration)} ${text}`
|
|
37
35
|
}, 100)
|
|
38
36
|
spinner.start()
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
const stop = () => {
|
|
42
|
-
spinner.
|
|
40
|
+
spinner.stop()
|
|
43
41
|
clearInterval(interval)
|
|
44
42
|
return elapsedTime()
|
|
45
43
|
}
|