ansimax 1.0.0
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.es.md +629 -0
- package/README.md +629 -0
- package/dist/index.d.mts +708 -0
- package/dist/index.d.ts +708 -0
- package/dist/index.js +1707 -0
- package/dist/index.mjs +1632 -0
- package/package.json +110 -0
package/README.md
ADDED
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="media/ansimax.png" alt="Ansimax" width="180"/>
|
|
4
|
+
|
|
5
|
+
# Ansimax
|
|
6
|
+
|
|
7
|
+
### The ultimate CLI rendering library for Node.js
|
|
8
|
+
|
|
9
|
+
Colors • Gradients • Animations • ASCII Art • Pixel Art • Components • Themes
|
|
10
|
+
|
|
11
|
+
[](#)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](tsconfig.json)
|
|
14
|
+
[](#)
|
|
15
|
+
[](#)
|
|
16
|
+
[](#)
|
|
17
|
+
|
|
18
|
+
**English** · [Español](README.es.md)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🎬 Live Preview
|
|
25
|
+
|
|
26
|
+
See Ansimax in action — every animation and loader running live:
|
|
27
|
+
|
|
28
|
+
### Animations
|
|
29
|
+
|
|
30
|
+
https://github.com/Brashkie/ansimax/raw/main/media/animations.mp4
|
|
31
|
+
|
|
32
|
+
### Loaders
|
|
33
|
+
|
|
34
|
+
https://github.com/Brashkie/ansimax/raw/main/media/loaders.mp4
|
|
35
|
+
|
|
36
|
+
> 💡 GitHub renders these MP4s as inline video players once the repo is pushed. Or run them locally with `npx tsx examples/animations.ts` and `npx tsx examples/loaders.ts`.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🌟 What is Ansimax?
|
|
41
|
+
|
|
42
|
+
**Ansimax** is a modern, zero-dependency rendering library for Node.js that turns your terminal into a vibrant, dynamic canvas. It bundles advanced ANSI colors, smooth animations, ASCII art, pixel art, interactive components, and theming into a single package — all written in strict TypeScript with full type definitions.
|
|
43
|
+
|
|
44
|
+
Built for developers who want to ship CLIs that **feel** professional.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 💡 Why Ansimax?
|
|
49
|
+
|
|
50
|
+
- ⚡ **Zero dependencies** — no bloat, no transitive vulnerabilities, no version conflicts
|
|
51
|
+
- 🎯 **One library instead of 10** — replaces `chalk` + `ora` + `cli-table3` + `figlet` + `gradient-string` + more
|
|
52
|
+
- 🎨 **True 24-bit color + gradients** out of the box — auto-fallback to 256/16 when needed
|
|
53
|
+
- 🧠 **Built for real-world CLIs** — `AbortSignal` support, `NO_COLOR` compliance, TTY-aware
|
|
54
|
+
- 🛡️ **100% test coverage** — 750+ tests across every module
|
|
55
|
+
- 📘 **TypeScript-first** — strict mode, full type defs, zero `any`
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🆚 Comparison
|
|
60
|
+
|
|
61
|
+
| Feature | **Ansimax** | chalk | ora | cli-table3 | figlet | gradient-string |
|
|
62
|
+
|----------------------|-------------|-------|------|------------|--------|-----------------|
|
|
63
|
+
| 16-color | ✅ | ✅ | ➖ | ➖ | ➖ | ➖ |
|
|
64
|
+
| 256-color | ✅ | ✅ | ➖ | ➖ | ➖ | ➖ |
|
|
65
|
+
| Truecolor (24-bit) | ✅ | ✅ | ➖ | ➖ | ➖ | ✅ |
|
|
66
|
+
| Gradients | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
|
|
67
|
+
| Animations | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
68
|
+
| Spinners | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
|
|
69
|
+
| Progress bars | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
70
|
+
| Tables | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
|
|
71
|
+
| ASCII art / banners | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
|
|
72
|
+
| Pixel art / canvas | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
73
|
+
| Themes | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
74
|
+
| AbortSignal support | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
75
|
+
| Zero dependencies | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
76
|
+
|
|
77
|
+
> Ansimax replaces 5+ separate packages with a single zero-dependency library.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 📦 Installation
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install ansimax
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
yarn add ansimax # Yarn
|
|
89
|
+
pnpm add ansimax # PNPM
|
|
90
|
+
bun add ansimax # Bun
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Requires Node.js >= 18**
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## ⚡ 30-second example
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { color } from 'ansimax';
|
|
101
|
+
|
|
102
|
+
console.log(color.green('Hello world'));
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
That's it. No config, no setup. Want more? Keep reading.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🚀 Quick Start
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { color, animate, loader, ascii, components, gradient } from 'ansimax';
|
|
113
|
+
|
|
114
|
+
// Colors with stacked styles (single ANSI reset, no nesting)
|
|
115
|
+
console.log(color.bold(color.cyan('Hello, terminal!')));
|
|
116
|
+
|
|
117
|
+
// Gradient text
|
|
118
|
+
console.log(gradient('Smooth color flow', ['#ff6b6b', '#feca57', '#48dbfb']));
|
|
119
|
+
|
|
120
|
+
// Animated typewriter
|
|
121
|
+
await animate.typewriter('Welcome to Ansimax...', { speed: 50 });
|
|
122
|
+
|
|
123
|
+
// Spinner with success state
|
|
124
|
+
const stop = loader.spin('Building project...', { color: '#00ff88' });
|
|
125
|
+
await doWork();
|
|
126
|
+
stop('Built successfully', true);
|
|
127
|
+
|
|
128
|
+
// ASCII banner
|
|
129
|
+
console.log(ascii.banner('ANSIMAX', { font: 'big', align: 'center' }));
|
|
130
|
+
|
|
131
|
+
// Component table
|
|
132
|
+
console.log(components.table([
|
|
133
|
+
['Name', 'Status'],
|
|
134
|
+
['Build', '✓ ready'],
|
|
135
|
+
], { header: true, borderStyle: 'rounded' }));
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## ✨ Features
|
|
141
|
+
|
|
142
|
+
| Module | Capabilities |
|
|
143
|
+
|---|---|
|
|
144
|
+
| 🎨 **Colors** | 16-color · 256-color · 24-bit truecolor · hex · RGB · `compose()` for stacking · `NO_COLOR` aware |
|
|
145
|
+
| 🌈 **Gradients** | Linear · multi-stop · rainbow · gradient rectangles (horizontal, vertical, diagonal, radial) |
|
|
146
|
+
| ⚡ **Animations** | typewriter · fadeIn · fadeOut · slide · pulse · wave · glitch · reveal — all `AbortSignal`-aware |
|
|
147
|
+
| 🔄 **Loaders** | 11 spinner styles · animated progress bars · multi-task runners (sequential & parallel) · countdowns |
|
|
148
|
+
| 🖼️ **ASCII Art** | Two built-in fonts · `box()` with 6 border styles · ANSI-aware dividers · banners with gradients |
|
|
149
|
+
| 🎬 **Frames** | Custom frame engines · live updating renders · loading bars · bouncing balls · **morph** (text→text) |
|
|
150
|
+
| 🧩 **Components** | Tables · status messages · badges · progress bars · timelines · interactive menus (single/multi-select) |
|
|
151
|
+
| 🌃 **Themes** | 8 built-in themes (Dracula, Nord, Monokai, Cyberpunk, Pastel, Matrix, Ocean, Sunset) · custom theme support |
|
|
152
|
+
| 🖌️ **Pixel Art** | Half-block rendering · sprite library · canvas drawing API · sprite transforms (flip, rotate) |
|
|
153
|
+
| 🛠️ **Utilities** | `truncateAnsi` · `wordWrap` (with soft-break) · `repeatVisible` · `stripAnsi` · color math |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 📸 Showcase
|
|
158
|
+
|
|
159
|
+
### Colors & Gradients
|
|
160
|
+
<div align="center">
|
|
161
|
+
<img src="media/colors.png" alt="Colors and gradients" width="700"/>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
import { color, gradient, rainbow, compose } from 'ansimax';
|
|
166
|
+
|
|
167
|
+
// 16, 256, and 24-bit colors
|
|
168
|
+
color.red('basic'); // 16-color
|
|
169
|
+
color.color256(196)('palette'); // 256-color
|
|
170
|
+
color.hex('#48dbfb')('truecolor'); // 24-bit
|
|
171
|
+
color.rgb(255, 100, 50)('custom'); // RGB
|
|
172
|
+
|
|
173
|
+
// Stack styles with compose() — single reset, no nesting
|
|
174
|
+
const errorStyle = compose(color.bold, color.red, color.underline);
|
|
175
|
+
console.log(errorStyle('CRITICAL ERROR'));
|
|
176
|
+
|
|
177
|
+
// Multi-stop gradients
|
|
178
|
+
gradient('Smooth flow', ['#ff6b6b', '#feca57', '#48dbfb']);
|
|
179
|
+
rainbow('Rainbow text!');
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### ASCII Art
|
|
185
|
+
<div align="center">
|
|
186
|
+
<img src="media/ascii_art.png" alt="ASCII art" width="700"/>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
import { ascii, rainbow } from 'ansimax';
|
|
191
|
+
|
|
192
|
+
ascii.big('HELLO'); // 5-line block font
|
|
193
|
+
ascii.small('hello'); // 3-line compact font
|
|
194
|
+
ascii.banner('ANSIMAX', {
|
|
195
|
+
font: 'big',
|
|
196
|
+
colorFn: rainbow,
|
|
197
|
+
align: 'center',
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
// Boxes with 6 border styles
|
|
201
|
+
ascii.box(rainbow('Rainbow box!'), {
|
|
202
|
+
borderStyle: 'double',
|
|
203
|
+
padding: 2,
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// ANSI-aware dividers
|
|
207
|
+
ascii.divider({
|
|
208
|
+
label: color.cyan(' SECTION '),
|
|
209
|
+
width: 60,
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### Components
|
|
216
|
+
<div align="center">
|
|
217
|
+
<img src="media/components.png" alt="UI components" width="700"/>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import { components } from 'ansimax';
|
|
222
|
+
|
|
223
|
+
// Tables with auto-sizing
|
|
224
|
+
components.table([
|
|
225
|
+
['Name', 'Status', 'Score'],
|
|
226
|
+
['Alice', '✓ active', '95'],
|
|
227
|
+
['Bob', '⚠ pending', '78'],
|
|
228
|
+
], { header: true, borderStyle: 'rounded' });
|
|
229
|
+
|
|
230
|
+
// Status messages
|
|
231
|
+
components.status('success', 'All tests passed');
|
|
232
|
+
components.status('error', 'Build failed');
|
|
233
|
+
components.status('warn', 'Deprecation notice');
|
|
234
|
+
|
|
235
|
+
// Badges
|
|
236
|
+
components.badge('VERSION', 'v1.0.0');
|
|
237
|
+
components.badge('BUILD', 'passing');
|
|
238
|
+
|
|
239
|
+
// Interactive menus (with AbortSignal support)
|
|
240
|
+
const choice = await components.menu([
|
|
241
|
+
'Install dependencies',
|
|
242
|
+
'Run tests',
|
|
243
|
+
'Deploy',
|
|
244
|
+
'Cancel',
|
|
245
|
+
], { multiSelect: false });
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### Timeline
|
|
251
|
+
<div align="center">
|
|
252
|
+
<img src="media/timeline.png" alt="Timeline component" width="700"/>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
components.timeline([
|
|
257
|
+
{ label: 'Project init', done: true, time: '10:00' },
|
|
258
|
+
{ label: 'Build pipeline', done: true, time: '10:15' },
|
|
259
|
+
{ label: 'Run tests', done: true, time: '10:32' },
|
|
260
|
+
{ label: 'Deploy to npm', done: false, time: 'pending' },
|
|
261
|
+
]);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### Loaders & Progress
|
|
267
|
+
<div align="center">
|
|
268
|
+
<img src="media/loaders.png" alt="Loaders and progress bars" width="700"/>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
import { loader } from 'ansimax';
|
|
273
|
+
|
|
274
|
+
// Spinner — 11 built-in styles
|
|
275
|
+
const stop = loader.spin('Processing...', {
|
|
276
|
+
type: 'dots', // dots, line, arrow, bounce, star, moon, clock...
|
|
277
|
+
color: '#00ff88',
|
|
278
|
+
signal: ctrl.signal, // AbortSignal aware
|
|
279
|
+
});
|
|
280
|
+
stop('Complete', true);
|
|
281
|
+
|
|
282
|
+
// Animated progress bar
|
|
283
|
+
await loader.progressAnimate(50, 'Installing', {
|
|
284
|
+
delay: 30,
|
|
285
|
+
color: '#48dbfb',
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// Multi-task runner — sequential or parallel
|
|
289
|
+
await loader.tasks([
|
|
290
|
+
{ text: 'Fetch deps', fn: async () => fetch() },
|
|
291
|
+
{ text: 'Compile src', fn: async () => compile() },
|
|
292
|
+
{ text: 'Run tests', fn: async () => test() },
|
|
293
|
+
], { parallel: false });
|
|
294
|
+
|
|
295
|
+
// Countdown
|
|
296
|
+
await loader.countdown(5, {
|
|
297
|
+
label: 'Launching in',
|
|
298
|
+
color: '#ffd700',
|
|
299
|
+
});
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### Pixel Art & Canvas
|
|
305
|
+
<div align="center">
|
|
306
|
+
<img src="media/pixel_art.png" alt="Pixel art and canvas drawing" width="700"/>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
import { images, createCanvas } from 'ansimax';
|
|
311
|
+
|
|
312
|
+
// Built-in sprites: heart, star, smiley, pacman
|
|
313
|
+
console.log(images.sprite('heart', { scale: 2 }));
|
|
314
|
+
|
|
315
|
+
// Sprite transforms
|
|
316
|
+
const flipped = images.flipHorizontal(images.sprites.heart.pixels);
|
|
317
|
+
const rotated = images.rotate90(images.sprites.star.pixels);
|
|
318
|
+
|
|
319
|
+
// Custom canvas drawing
|
|
320
|
+
const canvas = createCanvas(30, 10);
|
|
321
|
+
canvas.drawRect(0, 0, 30, 10, { r: 30, g: 30, b: 50 }, true);
|
|
322
|
+
canvas.drawCircle(15, 5, 4, { r: 255, g: 200, b: 0 }, true);
|
|
323
|
+
canvas.print();
|
|
324
|
+
|
|
325
|
+
// Gradient rectangles — horizontal, vertical, diagonal, radial
|
|
326
|
+
images.gradientRect({
|
|
327
|
+
width: 50, height: 8,
|
|
328
|
+
colors: ['#ff0080', '#7928ca', '#0070f3'],
|
|
329
|
+
style: 'radial',
|
|
330
|
+
});
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
### Themes
|
|
336
|
+
<div align="center">
|
|
337
|
+
<img src="media/themes.png" alt="Built-in themes" width="700"/>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
import { themes, color } from 'ansimax';
|
|
342
|
+
|
|
343
|
+
// 8 built-in themes
|
|
344
|
+
themes.use('dracula'); // 'dracula', 'nord', 'monokai', 'cyberpunk',
|
|
345
|
+
// 'pastel', 'matrix', 'ocean', 'sunset', 'custom'
|
|
346
|
+
|
|
347
|
+
const t = themes.current();
|
|
348
|
+
console.log(color.hex(t.primary)('Primary text'));
|
|
349
|
+
console.log(color.hex(t.error)('Error message'));
|
|
350
|
+
console.log(color.hex(t.success)('Success!'));
|
|
351
|
+
|
|
352
|
+
// Define your own theme
|
|
353
|
+
themes.define('mytheme', {
|
|
354
|
+
primary: '#00ff88',
|
|
355
|
+
secondary: '#0070f3',
|
|
356
|
+
accent: '#ffd700',
|
|
357
|
+
error: '#ff4757',
|
|
358
|
+
warning: '#ffa502',
|
|
359
|
+
success: '#2ed573',
|
|
360
|
+
});
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
### Get Started
|
|
366
|
+
<div align="center">
|
|
367
|
+
<img src="media/get_started.png" alt="Get started" width="700"/>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 📚 Full Examples
|
|
373
|
+
|
|
374
|
+
The `examples/` folder contains runnable demos:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# TypeScript demo (all modules)
|
|
378
|
+
npx tsx examples/demo.ts
|
|
379
|
+
|
|
380
|
+
# JavaScript demo (CommonJS)
|
|
381
|
+
npm run build
|
|
382
|
+
node examples/demo.js
|
|
383
|
+
|
|
384
|
+
# Visual showcase (great for screenshots)
|
|
385
|
+
npx tsx examples/showcase.ts
|
|
386
|
+
|
|
387
|
+
# Animations recording demo
|
|
388
|
+
npx tsx examples/animations.ts
|
|
389
|
+
|
|
390
|
+
# Loaders recording demo
|
|
391
|
+
npx tsx examples/loaders.ts
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 🎯 Use Cases
|
|
397
|
+
|
|
398
|
+
- **Professional CLIs** — build tools that feel polished, not bare
|
|
399
|
+
- **Build outputs** — replace boring `npm run build` logs with status timelines
|
|
400
|
+
- **Interactive installers** — multi-select menus with theme support
|
|
401
|
+
- **Live dashboards** — auto-refreshing frame engine with diff rendering
|
|
402
|
+
- **Terminal games** — pixel art canvas + animation engine
|
|
403
|
+
- **Dev tooling** — coverage reports, deployment trackers, status panels
|
|
404
|
+
- **Educational tools** — animated explainers right in the terminal
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## ⚙️ Configuration
|
|
409
|
+
|
|
410
|
+
```ts
|
|
411
|
+
import { configure } from 'ansimax';
|
|
412
|
+
|
|
413
|
+
configure({
|
|
414
|
+
colorMode: 'truecolor', // 'basic' | '256' | 'truecolor'
|
|
415
|
+
animationSpeed: 'normal', // 'slow' | 'normal' | 'fast'
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// Or override at runtime
|
|
419
|
+
import { setNoColor } from 'ansimax';
|
|
420
|
+
setNoColor(true); // disable all colors (CI environments)
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Ansimax also respects the standard `NO_COLOR` environment variable and auto-detects non-TTY stdout (pipes, CI logs).
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## 🛣️ Roadmap
|
|
428
|
+
|
|
429
|
+
Ansimax is being built toward a full **terminal rendering platform**. Here's what's done and what's next:
|
|
430
|
+
|
|
431
|
+
### ✅ Phase 1 — Core foundation (current)
|
|
432
|
+
|
|
433
|
+
- [x] **Styling engine** — ANSI 16 / 256 / truecolor with auto-fallback
|
|
434
|
+
- [x] **Hex + RGB helpers** with clamping and validation
|
|
435
|
+
- [x] **`NO_COLOR` env support** + non-TTY auto-detection
|
|
436
|
+
- [x] **`AbortSignal` integration** across animations and loaders
|
|
437
|
+
- [x] **`compose()` style stacking** with single-reset emission
|
|
438
|
+
|
|
439
|
+
### ✅ Phase 2 — Gradient engine
|
|
440
|
+
|
|
441
|
+
- [x] Linear gradients (multi-stop)
|
|
442
|
+
- [x] Rainbow presets
|
|
443
|
+
- [x] Radial gradients (in `gradientRect`)
|
|
444
|
+
- [x] Diagonal gradients
|
|
445
|
+
- [ ] **Animated gradients** (color flow over time)
|
|
446
|
+
|
|
447
|
+
### 🟡 Phase 3 — ASCII engine
|
|
448
|
+
|
|
449
|
+
- [x] Block fonts (`big`, `small`)
|
|
450
|
+
- [x] Banner with gradient + alignment
|
|
451
|
+
- [x] Box drawing (6 border styles)
|
|
452
|
+
- [ ] **Image → ASCII** converter (with edge detection)
|
|
453
|
+
- [ ] **Color ASCII** rendering (preserve image colors)
|
|
454
|
+
- [ ] **Image dithering** for better tonal range
|
|
455
|
+
- [ ] **Face-optimized ASCII** (high-detail mode for portraits)
|
|
456
|
+
|
|
457
|
+
### ✅ Phase 4 — Terminal UI primitives
|
|
458
|
+
|
|
459
|
+
- [x] Tables (irregular rows, jagged data)
|
|
460
|
+
- [x] Boxes with multiple styles
|
|
461
|
+
- [x] Status messages + badges
|
|
462
|
+
- [x] Timelines with done/pending states
|
|
463
|
+
- [x] Interactive menus (single + multi-select)
|
|
464
|
+
- [ ] **Trees** (collapsible, lazy-loadable)
|
|
465
|
+
- [ ] **Panels** (split layouts)
|
|
466
|
+
- [ ] **Layouts** (flexbox-style positioning)
|
|
467
|
+
|
|
468
|
+
### ✅ Phase 5 — Cursor & screen control
|
|
469
|
+
|
|
470
|
+
- [x] Cursor visibility, save/restore, positioning
|
|
471
|
+
- [x] Screen clearing (line, area, full)
|
|
472
|
+
- [x] Try/finally cleanup guarantees
|
|
473
|
+
|
|
474
|
+
### ✅ Phase 6 — Animation engine
|
|
475
|
+
|
|
476
|
+
- [x] Typewriter, fadeIn, fadeOut, slide, pulse, wave, glitch, reveal
|
|
477
|
+
- [x] All `AbortSignal`-aware
|
|
478
|
+
- [x] `reducedMotion` mode for accessibility
|
|
479
|
+
- [x] **Frame morph** (text → text interpolation)
|
|
480
|
+
|
|
481
|
+
### 🟡 Phase 7 — Progress ecosystem
|
|
482
|
+
|
|
483
|
+
- [x] Spinners (11 styles) with color + AbortSignal
|
|
484
|
+
- [x] Animated progress bars
|
|
485
|
+
- [x] Multi-task runners (sequential + parallel)
|
|
486
|
+
- [x] Countdown timers
|
|
487
|
+
- [ ] **Nested progress** (parent + children with rollup)
|
|
488
|
+
- [ ] **ETA estimation** (rolling average + projection)
|
|
489
|
+
- [ ] **Live refresh** without flicker (diff renderer)
|
|
490
|
+
|
|
491
|
+
### 🟡 Phase 8 — Capability detection
|
|
492
|
+
|
|
493
|
+
- [x] TTY detection (auto-disable in pipes/CI)
|
|
494
|
+
- [x] `NO_COLOR` env support
|
|
495
|
+
- [ ] **Color depth detection** (16 / 256 / truecolor)
|
|
496
|
+
- [ ] **Unicode width detection** (CJK, emoji)
|
|
497
|
+
- [ ] **Terminal capability database** (xterm, iTerm, Windows Terminal...)
|
|
498
|
+
|
|
499
|
+
### 🔴 Phase 9 — Advanced rendering
|
|
500
|
+
|
|
501
|
+
- [ ] **Diff renderer** (only redraw changed regions)
|
|
502
|
+
- [ ] **Virtual buffer** (compose UI without writing to stdout)
|
|
503
|
+
- [ ] **Z-index / layering**
|
|
504
|
+
- [ ] **Mouse event support**
|
|
505
|
+
|
|
506
|
+
### 🔴 Phase 10 — Terminal charts
|
|
507
|
+
|
|
508
|
+
- [ ] Bar charts (horizontal + vertical)
|
|
509
|
+
- [ ] Line charts (with braille for sub-character resolution)
|
|
510
|
+
- [ ] Sparklines
|
|
511
|
+
- [ ] Heatmaps
|
|
512
|
+
- [ ] Real-time streaming charts
|
|
513
|
+
|
|
514
|
+
### 🔴 Phase 11 — Plugin system
|
|
515
|
+
|
|
516
|
+
- [ ] Plugin API for custom components
|
|
517
|
+
- [ ] Theme marketplace
|
|
518
|
+
- [ ] Custom font registration
|
|
519
|
+
- [ ] Community animations registry
|
|
520
|
+
|
|
521
|
+
**Legend:** ✅ Complete · 🟡 Partial · 🔴 Planned
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## 🧪 Testing
|
|
526
|
+
|
|
527
|
+
Ansimax ships with **750+ tests** and **100% line coverage**:
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
npm test # Run all tests
|
|
531
|
+
npm run test:coverage # Coverage report
|
|
532
|
+
npm run typecheck # Strict TypeScript check
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
---
|
|
536
|
+
|
|
537
|
+
## 🛠️ Requirements
|
|
538
|
+
|
|
539
|
+
- Node.js **>= 18.0.0**
|
|
540
|
+
- A terminal with ANSI escape support (every modern terminal)
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## 🏗️ Project Structure
|
|
545
|
+
|
|
546
|
+
```
|
|
547
|
+
ansimax/
|
|
548
|
+
├── src/
|
|
549
|
+
│ ├── colors/ # Color system, gradients, compose, NO_COLOR
|
|
550
|
+
│ ├── animations/ # 7 animation effects with AbortSignal
|
|
551
|
+
│ ├── ascii/ # ASCII fonts, boxes, dividers, banners
|
|
552
|
+
│ ├── components/ # Tables, menus, timelines, badges
|
|
553
|
+
│ ├── loaders/ # Spinners, progress, tasks, countdowns
|
|
554
|
+
│ ├── frames/ # Frame engine + morph + presets
|
|
555
|
+
│ ├── images/ # Pixel art, sprites, canvas API
|
|
556
|
+
│ ├── themes/ # 8 built-in themes + custom
|
|
557
|
+
│ ├── utils/ # ANSI helpers, color math, string utils
|
|
558
|
+
│ └── index.ts # Public API barrel
|
|
559
|
+
├── examples/ # Runnable demos (TS + JS)
|
|
560
|
+
├── media/ # README screenshots and videos
|
|
561
|
+
└── dist/ # Build output (CJS + ESM + types)
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## 🤝 Contributing
|
|
567
|
+
|
|
568
|
+
Contributions are welcome! To get started:
|
|
569
|
+
|
|
570
|
+
1. **Fork** the repo
|
|
571
|
+
2. Create a branch: `git checkout -b feature/amazing-thing`
|
|
572
|
+
3. Add tests for your changes (the bar is 100% coverage)
|
|
573
|
+
4. Commit: `git commit -m 'Add: amazing thing'`
|
|
574
|
+
5. Push: `git push origin feature/amazing-thing`
|
|
575
|
+
6. Open a Pull Request
|
|
576
|
+
|
|
577
|
+
Make sure:
|
|
578
|
+
- All tests pass: `npm test`
|
|
579
|
+
- TypeScript is happy: `npm run typecheck`
|
|
580
|
+
- Code follows the existing style
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
## 🐛 Reporting Issues
|
|
585
|
+
|
|
586
|
+
Found a bug or have a feature idea? Open an [issue](https://github.com/Brashkie/ansimax/issues) — please include a minimal reproduction.
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## ⭐ Support
|
|
591
|
+
|
|
592
|
+
If you like Ansimax:
|
|
593
|
+
|
|
594
|
+
- ⭐ **Star the repo** — helps others discover the project
|
|
595
|
+
- 🐛 **Report bugs** — open an [issue](https://github.com/Brashkie/ansimax/issues)
|
|
596
|
+
- 🚀 **Use it in your CLI projects** — that's the best support there is
|
|
597
|
+
- 📢 **Share it** — tweet, blog, mention it to a colleague who builds CLIs
|
|
598
|
+
- 💬 **Spread the word** — tag your CLI with `#ansimax` so others can find inspiration
|
|
599
|
+
|
|
600
|
+
This helps the project grow and gives momentum to add the planned features faster.
|
|
601
|
+
|
|
602
|
+
---
|
|
603
|
+
|
|
604
|
+
## 📝 Changelog
|
|
605
|
+
|
|
606
|
+
See [CHANGELOG.md](CHANGELOG.md) for the version history.
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
## 👨💻 Author
|
|
611
|
+
|
|
612
|
+
**Brashkie** · [@Brashkie](https://github.com/Brashkie)
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
## 📜 License
|
|
617
|
+
|
|
618
|
+
[MIT](LICENSE) © 2026 Brashkie
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
**Keywords:** cli, terminal, ansi, colors, gradients, animation, spinner, ascii, ascii-art, pixel-art, progress-bar, loader, components, table, banner, theme, typescript, nodejs, zero-dependencies
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
<div align="center">
|
|
627
|
+
<p>Built with ❤️ and TypeScript</p>
|
|
628
|
+
<p>If Ansimax helps you ship better CLIs, give it a ⭐ on GitHub!</p>
|
|
629
|
+
</div>
|