coffee-time 1.2.0-beta.4 → 1.2.0-beta.5
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 +1 -1
- package/bin/coffee-time.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ coffee-time start --interval 45 --status
|
|
|
47
47
|
* Prints a single startup line:
|
|
48
48
|
`Coffee breaks scheduled every 45 minutes. Press Ctrl+C to stop.`
|
|
49
49
|
* Optional status flag (`--status`) prints a countdown update every minute:
|
|
50
|
-
|
|
50
|
+
`⏰ Next break in 44 minutes`
|
|
51
51
|
* Waits 45 minutes, then triggers a break notification.
|
|
52
52
|
* After each break, countdown updates continue when `--status` is enabled.
|
|
53
53
|
* Immediately schedules the next interval and repeats until you stop it (`Ctrl+C`).
|
package/bin/coffee-time.js
CHANGED
|
@@ -97,9 +97,9 @@ function notify(intervalMinutes, logLine = console.log) {
|
|
|
97
97
|
|
|
98
98
|
function formatRemaining(remainingMs) {
|
|
99
99
|
const totalSeconds = Math.max(0, Math.ceil(remainingMs / 1000));
|
|
100
|
-
const minutes = Math.
|
|
101
|
-
const
|
|
102
|
-
return `${
|
|
100
|
+
const minutes = Math.max(0, Math.ceil(totalSeconds / 60));
|
|
101
|
+
const unit = minutes === 1 ? 'minute' : 'minutes';
|
|
102
|
+
return `${minutes} ${unit}`;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
function printCoffeeArt() {
|
|
@@ -196,7 +196,7 @@ function startLoop(intervalMinutes, options = {}) {
|
|
|
196
196
|
|
|
197
197
|
const logStatus = () => {
|
|
198
198
|
const remaining = nextTime - Date.now();
|
|
199
|
-
const message =
|
|
199
|
+
const message = `⏰ Next break in ${formatRemaining(remaining)}`;
|
|
200
200
|
const paddedMessage = message.padEnd(statusLength, ' ');
|
|
201
201
|
process.stdout.write(`\r${paddedMessage}`);
|
|
202
202
|
statusLength = message.length;
|