nanospinner
Advanced tools
Comparing version 0.6.0 to 1.0.0
@@ -12,4 +12,4 @@ interface Options { | ||
error(opts?: { text?: string; mark?: string }): Spinner | ||
stop(opts?: { text?: string; mark?: string }): Spinner | ||
start(opts?: { text?: string, color?: string }): Spinner | ||
stop(opts?: { text?: string; mark?: string; color?: string }): Spinner | ||
start(opts?: { text?: string; color?: string }): Spinner | ||
update(opts?: Options): Spinner | ||
@@ -16,0 +16,0 @@ reset(): Spinner |
14
index.js
@@ -18,3 +18,3 @@ const pico = require('picocolors') | ||
stream = opts.stream || process.stderr, | ||
frames = opts.frames || symbols.frames, | ||
frames = opts.frames && opts.frames.length ? opts.frames : symbols.frames, | ||
color = opts.color || 'yellow', | ||
@@ -67,5 +67,10 @@ lines = 0, | ||
text = opts.text || text | ||
frames = opts.frames || frames | ||
frames = opts.frames && opts.frames.length ? opts.frames : frames | ||
interval = opts.interval || interval | ||
color = opts.color || color | ||
if (frames.length - 1 < current) { | ||
current = 0 | ||
} | ||
return spinner | ||
@@ -87,4 +92,5 @@ }, | ||
let mark = pico[color](frames[current]) | ||
spinner.write(`${opts.mark || mark} ${opts.text || text}\n`, true) | ||
let mark = pico[opts.color || color](frames[current]) | ||
let optsMark = opts.mark && opts.color ? pico[opts.color](opts.mark) : opts.mark | ||
spinner.write(`${optsMark || mark} ${opts.text || text}\n`, true) | ||
@@ -91,0 +97,0 @@ return isTTY ? spinner.write(`\x1b[?25h`) : spinner |
{ | ||
"name": "nanospinner", | ||
"version": "0.6.0", | ||
"version": "1.0.0", | ||
"description": "The simplest and tiniest terminal spinner for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5612
128
1