codetype 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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -25
  3. package/package.json +3 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rohan4naik
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 CHANGED
@@ -1,17 +1,56 @@
1
- # CodeType
1
+ <div align="center">
2
2
 
3
- Offline terminal code-typing practice game. Pure Python stdlib (curses) — no network, no heavy deps.
3
+ # ⌨️ CodeType
4
4
 
5
- ## Install & run
5
+ **Offline terminal code-typing practice — sharpen your speed on real code.**
6
6
 
7
- With [pipx](https://pipx.pypa.io) (recommended — gives you the `codetype` command everywhere):
7
+ [![npm version](https://img.shields.io/npm/v/codetype.svg)](https://www.npmjs.com/package/codetype)
8
+ [![npm downloads](https://img.shields.io/npm/dm/codetype.svg)](https://www.npmjs.com/package/codetype)
9
+ [![license](https://img.shields.io/npm/l/codetype.svg)](./LICENSE)
10
+ [![python](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/)
11
+
12
+ A fast, distraction-free typing trainer that runs entirely in your terminal.
13
+ Practice on real snippets across nine languages, track your WPM, and beat your
14
+ own records — no browser, no accounts, no network.
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## ✨ Features
21
+
22
+ - **Real code, nine languages** — Python, JavaScript, TypeScript, C, Go, Rust, Java, SQL, and Bash.
23
+ - **Speed-test mode** — a fresh block of common words each run for raw typing speed.
24
+ - **Live metrics** — WPM, accuracy, and a timer that starts on your first keystroke.
25
+ - **Smart indentation** — leading whitespace on new lines auto-skips, so you type code, not spaces.
26
+ - **Persistent stats** — every run is saved locally; view your history and per-language bests anytime.
27
+ - **Fully offline** — pure Python standard library (`curses`). No dependencies, no telemetry.
28
+
29
+ ---
30
+
31
+ ## 🚀 Installation
32
+
33
+ ### Via npm (recommended)
8
34
 
9
35
  ```sh
10
- pipx install git+https://github.com/rohan4naik/codetype-cli
36
+ npm install -g codetype
11
37
  codetype
12
38
  ```
13
39
 
14
- Or with pip from a clone:
40
+ > Requires **Python 3.8+** on your `PATH`. The npm package ships a small Node
41
+ > launcher that runs the bundled Python game. On Windows the launcher will
42
+ > prompt you to `pip install windows-curses` if needed.
43
+
44
+ ### Via pip / pipx
45
+
46
+ If you prefer a native Python install:
47
+
48
+ ```sh
49
+ pipx install codetype-cli
50
+ codetype
51
+ ```
52
+
53
+ Or from a clone:
15
54
 
16
55
  ```sh
17
56
  git clone https://github.com/rohan4naik/codetype-cli
@@ -20,36 +59,54 @@ pip install .
20
59
  codetype
21
60
  ```
22
61
 
23
- Or no install at all — run straight from the clone:
62
+ ### No install
63
+
64
+ Run straight from a clone:
24
65
 
25
66
  ```sh
26
67
  python3 -m codetype
27
68
  ```
28
69
 
29
- Windows: `pip install .` pulls in `windows-curses` automatically.
70
+ ---
71
+
72
+ ## 🎮 How to play
73
+
74
+ 1. **Pick a mode** from the menu — a language, `sentences (speed test)`, or `random`.
75
+ 2. **Type the snippet exactly.** Correct characters turn green; mistakes flash red and must be
76
+ backspaced before you can continue.
77
+ 3. **Press Enter** at the end of each line — indentation on the next line is skipped for you.
78
+ 4. **Watch your stats** update live in the header, then review your result on the finish screen.
30
79
 
31
- ## How it works
80
+ Select `history` from the menu to see your last 15 runs and all-time bests per language.
32
81
 
33
- - Pick a language from the menu (python / javascript / typescript / c / go / rust / java / sql / bash / random).
34
- - Or pick **sentences (speed test)** — a fresh block of random common words every run, for raw typing speed. Space or Enter both work at line wraps.
35
- - Type the snippet exactly. Correct chars turn green, mistakes show red and must be backspaced before you can continue.
36
- - Press Enter at end of line — leading indentation of the next line is auto-skipped (shown dim, not counted toward WPM).
37
- - Live WPM, accuracy, and timer in the header. Timer starts on your first keystroke.
38
- - `history` in the menu shows your last 15 runs and per-language bests.
82
+ ---
39
83
 
40
- ## Keys
84
+ ## ⌨️ Keys
41
85
 
42
86
  | Key | Action |
43
- |---|---|
44
- | Tab | Restart current snippet |
45
- | Esc | Back to menu / quit |
46
- | Backspace | Fix mistake |
47
- | Enter (results) | Next snippet |
87
+ | --- | --- |
88
+ | `↑` `↓` / `k` `j` | Navigate menu |
89
+ | `Enter` | Select / new line / next snippet |
90
+ | `Backspace` | Fix a mistake |
91
+ | `Tab` | Restart current snippet |
92
+ | `Esc` | Back to menu / quit |
93
+
94
+ ---
95
+
96
+ ## 📊 Stats
97
+
98
+ Every completed run is appended to `~/.codetype/stats.json` — WPM, accuracy, errors, time, and
99
+ date. The results screen highlights a **★ new best** whenever you beat your record for that language.
100
+
101
+ ---
102
+
103
+ ## 🧩 Adding your own snippets
48
104
 
49
- ## Stats
105
+ Edit [`codetype/snippets.py`](./codetype/snippets.py) — append strings to any language list, or add a
106
+ new language key. Use spaces for indentation, not tabs.
50
107
 
51
- Every completed run is appended to `~/.codetype/stats.json` (WPM, accuracy, errors, time, date). Results screen shows your per-language best.
108
+ ---
52
109
 
53
- ## Adding snippets
110
+ ## 📄 License
54
111
 
55
- Edit `codetype/snippets.py` — append strings to any language list or add a new language key. Use spaces for indentation, not tabs.
112
+ [MIT](./LICENSE) © [rohan4naik](https://github.com/rohan4naik)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codetype",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Offline terminal code-typing practice game (Python-powered)",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -9,7 +9,8 @@
9
9
  "files": [
10
10
  "bin/",
11
11
  "codetype/**/*.py",
12
- "README.md"
12
+ "README.md",
13
+ "LICENSE"
13
14
  ],
14
15
  "engines": {
15
16
  "node": ">=14"