@jsenv/log
Advanced tools
Comparing version 1.5.1 to 1.5.2
{ | ||
"name": "@jsenv/log", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "Nice and dynamic logs in the terminal", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -23,15 +23,16 @@ export const startSpinner = ({ | ||
log.write(render()) | ||
interval = setInterval(() => { | ||
frameIndex = frameIndex === frames.length - 1 ? 0 : frameIndex + 1 | ||
log.dynamicWrite(({ outputFromOutside }) => { | ||
if (outputFromOutside && stopOnWriteFromOutside) { | ||
stop() | ||
return "" | ||
} | ||
return render() | ||
}) | ||
}, 1000 / fps) | ||
if (!keepProcessAlive) { | ||
interval.unref() | ||
if (process.stdout.isTTY) { | ||
interval = setInterval(() => { | ||
frameIndex = frameIndex === frames.length - 1 ? 0 : frameIndex + 1 | ||
log.dynamicWrite(({ outputFromOutside }) => { | ||
if (outputFromOutside && stopOnWriteFromOutside) { | ||
stop() | ||
return "" | ||
} | ||
return render() | ||
}) | ||
}, 1000 / fps) | ||
if (!keepProcessAlive) { | ||
interval.unref() | ||
} | ||
} | ||
@@ -38,0 +39,0 @@ |
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
13501
285