@microlink/cli 2.0.10 → 2.0.13

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/README.md CHANGED
@@ -15,4 +15,4 @@ npm install @microlink/cli --global
15
15
  **microlink** © [Microlink](https://microlink.io), Released under the [MIT](https://github.com/microlinkhq/cli/blob/master/LICENSE.md) License.<br>
16
16
  Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/microlinkhq/cli/contributors).
17
17
 
18
- > [microlink.io](https://microlink.io) · GitHub [@MicrolinkHQ](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)
18
+ > [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)
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.10",
5
+ "version": "2.0.13",
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
- "nanospinner": "~0.6.0",
41
- "picocolors": "~1.0.0",
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
@@ -24,6 +24,4 @@ const cli = meow({
24
24
  }
25
25
  })
26
26
 
27
- if (cli.flags.apiKey) cli.flags.endpoint = 'https://pro.microlink.io'
28
-
29
27
  module.exports = cli
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 = createSpinner(text, { color: 'white' })
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,17 +31,14 @@ 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 = () => {
40
+ spinner.stop()
42
41
  clearInterval(interval)
43
- spinner.clear()
44
- process.stderr.write('\u001B[?25h')
45
42
  return elapsedTime()
46
43
  }
47
44