crisis-to-calm 1.0.0 → 1.0.1
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/LICENSE +21 -0
- package/README.md +90 -0
- package/index.js +20 -6
- package/package.json +1 -1
- package/calm.exe +0 -0
- package/calm.zip +0 -0
- package/stats.json +0 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SofiaOrj
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# 🌿 Crisis to Calm
|
|
2
|
+
|
|
3
|
+
A mindful breathing tool for your terminal. Designed to help developers reset, refocus, and track their mental well-being during long coding sessions.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
- **Square Breathing:** Follow the 4-step box breathing method (Inhale, Hold, Exhale, Hold).
|
|
7
|
+
- **Themes:** Multiple visual modes like `--ocean`, `--forest`, `--space`, and more!
|
|
8
|
+
- **Gamification:** Earn "Breaths," track your daily streak, and level up from **Baby Breather** to **Zen Legend**.
|
|
9
|
+
- **Deep Focus:** A distraction-free mode that hides the cursor and uses system beeps to bring you back to the presentation.
|
|
10
|
+
- **Wellness Check:** A post-session check-in to provide mental health resources if you're feeling stressed.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### Using NPM (Recommended)
|
|
15
|
+
- Prerequisite: Node.js
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g crisis-to-calm
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### From source
|
|
21
|
+
- Close the repository
|
|
22
|
+
- Enter directory
|
|
23
|
+
```bash
|
|
24
|
+
cd crisis-to-calm
|
|
25
|
+
```
|
|
26
|
+
- Install dependencies
|
|
27
|
+
```bash
|
|
28
|
+
npm install
|
|
29
|
+
```
|
|
30
|
+
- Link command
|
|
31
|
+
```bash
|
|
32
|
+
npm link
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Using .exe file
|
|
36
|
+
- Navigate to releases and download calm.exe
|
|
37
|
+
- To run the default version, open calm.exe
|
|
38
|
+
- To run with flags:
|
|
39
|
+
- Navigate to the folder where calm.exe is located
|
|
40
|
+
- Type `.\calm.exe` and add any flags (ex. `--forest --6 --deep`)
|
|
41
|
+
- Run
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
Simply type `calm` to start a standard session, or use flags to customize your experience:
|
|
46
|
+
|
|
47
|
+
### Configuration Flags
|
|
48
|
+
|
|
49
|
+
| Flag | Description |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `--[number]` | Set breath length in seconds (e.g., `--6`, `--10`). Default is 4. |
|
|
52
|
+
| `--deep` | Enter Deep Focus mode (hides cursor, system beeps). |
|
|
53
|
+
| `--random` | Picks a random theme for your session. |
|
|
54
|
+
| `--stats` | View your Rank, Streak, and total breaths taken. |
|
|
55
|
+
| `--help` | Display the manual. |
|
|
56
|
+
| `--reset` | Delete all progress and start fresh. |
|
|
57
|
+
|
|
58
|
+
### Visual Themes
|
|
59
|
+
|
|
60
|
+
Choose a theme that matches your current vibe:
|
|
61
|
+
|
|
62
|
+
* `--forest` ♣
|
|
63
|
+
* `--ocean` ~
|
|
64
|
+
* `--mountain` ▲
|
|
65
|
+
* `--space` *
|
|
66
|
+
* `--happy` Ü
|
|
67
|
+
* `--surprised` ö
|
|
68
|
+
* `--rainbow` • (Animated!)
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Ranks & Progression
|
|
73
|
+
|
|
74
|
+
Your progress is saved locally in your home directory (`~/.crisis-to-calm-stats.json`). Take breaths to unlock new titles:
|
|
75
|
+
|
|
76
|
+
* **Baby Breather** (0 breaths)
|
|
77
|
+
* **Novice Breather** (50 breaths)
|
|
78
|
+
* **Calm Novice** (100 breaths)
|
|
79
|
+
* **Calm Apprentice** (250 breaths)
|
|
80
|
+
* **Steady Hand** (500 breaths)
|
|
81
|
+
* **Breath Royalty** (1,000 breaths)
|
|
82
|
+
* **Breath Master** (2,500 breaths)
|
|
83
|
+
* **Calm Sage** (5,000 breaths)
|
|
84
|
+
* **Zen Legend** (10,000 breaths)
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
This project is licensed under the MIT License - see the [LICENSE](https://www.google.com/search?q=LICENSE) file for details.
|
|
89
|
+
|
|
90
|
+
```
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import os from 'os';
|
|
4
4
|
import chalk from 'chalk';
|
|
@@ -50,18 +50,32 @@ function updateStats(cyclesCompleted) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const oldRank = stats.rank;
|
|
53
|
-
const today = new Date().
|
|
53
|
+
const today = new Date().toISOString().split('T')[0];
|
|
54
54
|
const breathsEarned = cyclesCompleted * 4;
|
|
55
55
|
|
|
56
56
|
// Update totals and streak
|
|
57
57
|
if (breathsEarned > 0) {
|
|
58
|
+
// If it's the first time ever
|
|
58
59
|
if (!stats.lastDate) {
|
|
59
60
|
stats.streak = 1;
|
|
60
|
-
}
|
|
61
|
+
}
|
|
62
|
+
// If they already breathed today, don't change the streak
|
|
63
|
+
else if (stats.lastDate === today) {
|
|
64
|
+
// Streak stays the same
|
|
65
|
+
}
|
|
66
|
+
// If it's a new day, check if it was yesterday
|
|
67
|
+
else {
|
|
61
68
|
const yesterday = new Date();
|
|
62
69
|
yesterday.setDate(yesterday.getDate() - 1);
|
|
63
|
-
|
|
70
|
+
const yesterdayString = yesterday.toLocaleDateString();
|
|
71
|
+
|
|
72
|
+
if (stats.lastDate === yesterdayString) {
|
|
73
|
+
stats.streak += 1; // Increment streak.
|
|
74
|
+
} else {
|
|
75
|
+
stats.streak = 1; // Reset to 1.
|
|
76
|
+
}
|
|
64
77
|
}
|
|
78
|
+
stats.lastDate = today; // Mark today as the last breathing day
|
|
65
79
|
}
|
|
66
80
|
|
|
67
81
|
stats.totalBreaths += breathsEarned;
|
|
@@ -305,8 +319,8 @@ function displayHelp() {
|
|
|
305
319
|
}
|
|
306
320
|
|
|
307
321
|
async function startBreathing() {
|
|
308
|
-
const args = process.argv; // Get all command
|
|
309
|
-
if (args.includes('--help') || args.includes('
|
|
322
|
+
const args = process.argv; // Get all command line arguments
|
|
323
|
+
if (args.includes('--help') || args.includes('--h')) {
|
|
310
324
|
displayHelp();
|
|
311
325
|
process.exit();
|
|
312
326
|
}
|
package/package.json
CHANGED
package/calm.exe
DELETED
|
Binary file
|
package/calm.zip
DELETED
|
Binary file
|