Zero-dep terminal styler with glows, boxes, tables, loadings, themes, CLI, and procedural previews. Build pro CLIs effortlessly!
npm install termglow   
Termglow is a zero-dependency terminal and console styler for Node.js developers. Glow up your CLI outputs with stunning ANSI effects, Unicode boxes, animated spinners, progress bars, interactive prompts, procedural image previews, and more. Inspired by modern dev tools like Consola and your favorite terminal screenshotsβbuild polished, professional interfaces without bloat. Perfect for NPM packages, scripts, or full CLIs!
Created by DanuZz β Making terminals shine! π
- Styled Logs π¬: Success, error, warning, info with icons and auto-glow.
- Unicode Boxes π¦: Single/double borders, paddingβwrap text beautifully.
- Animated Loadings β³: Spinners with multi-phases (e.g., "Fetching > Building > Done").
- Progress Bars π: Custom signals (βΆ, βΈ, β, π, βΉ, β
) + percentages.
- Interactive Prompts β: Yes/no questions for user input.
- Glow Text β¨: Pulsing animations for emphasis.
- Procedural Image Previews πΌοΈ: Hash-based ASCII art (unique per fileβno libs needed!).
- File Stats π: Quick tables for size, hash, modified date.
- Data Tables ποΈ: Aligned Unicode grids for comparisons/logs.
- Themes π¨: Switch between 'default', 'neon', 'dark'βadapts to terminal size.
- CLI Mode π§: Instant commands like npx termglow box "Hello!".
- Zero Deps β‘: Pure Node.jsβruns anywhere, tiny installs.
``bashAs library
npm install termglow
π― Quick Start
Import and glow:
`javascript
const glow = require('termglow');// Switch theme for neon vibes
glow.theme('neon');
// Log with auto-glow
glow.log('success', 'Project built! π');
// Boxed message
glow.box('I am a glowing box\nWith multi-line support!', { padding: 2, border: 'single' });
// Animated loading
glow.loading('Building...', ['Compiling', 'Linking', 'Done'], 3000);
`Run the demo:
npm run demo (after cloning).π οΈ CLI Usage
Termglow doubles as a zero-install CLI. No setupβjust
npx termglow!`bash
Help
npx termglow helpBox
npx termglow box "Your styled message"Table (renders example data)
npx termglow tableLoading spinner
npx termglow loadingProgress animation
npx termglow progressGlow text
npx termglow glow "Pulsing demo"Theme switch
npx termglow theme neonImage preview (procedural ASCII)
npx termglow image ./path/to/image.pngFile stats table
npx termglow stats ./yourfile.js
`Pro Tip: Pipe data to CLI for dynamic use (extend with JSON parsing in future).
π All Usages & Examples
Here's every feature in action. Copy-paste into your scripts!
$3
`javascript
glow.log('success', 'All tests passed! β
');
glow.log('error', 'Build failedβcheck logs. β');
glow.log('warning', 'Deprecated feature used. β οΈ');
glow.log('info', 'Fetching data... βΉοΈ');
`Output: Colored icons + glowing text pulses.
$3
`javascript
glow.box('Simple single-line box.', { border: 'single', padding: 1 });
glow.box('Multi-line\ncontent with\ndouble borders!', { border: 'double', padding: 2 });
`Output:
`
ββββββββββββββββ
β β
β Multi-line β
β content with β
β double β
β borders! β
β β
ββββββββββββββββ
`$3
`javascript
const data = [
['Library', 'Deps', 'Features'],
['Termglow', '0', 'Glows, Tables, CLI π'],
['Other Tool', '5+', 'Basic Logs']
];
glow.table(data, { headers: true, border: 'double', color: glow.colors.fg.yellow });
`Output: Aligned Unicode grid (headers separated).
$3
`javascript
// Basic
glow.loading('Installing deps...', 2000);// Multi-phase
glow.loading('Full Workflow', ['Downloading', 'Installing', 'Configuring'], 5000);
`Output: Spinning dots + phase updates, ends with success log.
$3
`javascript
// With custom signal
glow.progress(75, 100, { message: 'Uploading', signal: 'π' });
glow.progress(100, 100, { message: 'Complete!', signal: 'β
' });// Loop for animation
for (let i = 0; i <= 100; i += 10) {
glow.progress(i, 100, { signal: 'βΆ' });
}
`Output:
`
π [ββββββββββββββββββββββ] 75.0% Uploading
`$3
`javascript
// Yes/No
const shouldDeploy = await glow.prompt('Deploy to prod?', { yesNo: true });
if (shouldDeploy) {
glow.log('success', 'Deploying...');
}// Free text
const name = await glow.prompt('Enter your name:');
glow.log('info',
Hello, ${name}!);
`Output: Green prompt arrow, handles input gracefully.
$3
`javascript
// One-shot glow
glow.glowText('This pulses once! β¨');// Continuous (stop manually)
const interval = glow.glowText('Live glow...', glow.colors.fg.magenta, true);
setTimeout(() => clearInterval(interval), 5000);
`Output: Text cycles brightness/dimness for neon effect.
$3
`javascript
glow.image('./your-image.png', { width: 30, height: 15 });
`Output:
`
πΌοΈ Previewing: ./your-image.png | Size: 42.5 KB | Hash: a1b2c3d4...
βββββββββββ (procedural ASCII art)
βββββββββββ Unique per fileβfun & dep-free!
`$3
`javascript
glow.fileStats('./index.js');
`Output: Table with size, modified date, MD5 hash.
$3
`javascript
glow.theme('default'); // Reset
glow.theme('neon'); // Bright colors
glow.theme('dark'); // Muted tones
`Output: Applies globallyβe.g., neon brightens cyan/magenta.
$3
See examples/demo.js for a build/deploy flow mimicking terminal screenshots (logs, errors, boxes, prompts).π§ Development
- Run Demos:
npm run demo or npm run table-demo.
- Tests: npm test (basic output checks).
- Lint: npx eslint . (uses .eslintrc.js).
- Publish: npm publish (.npmignore keeps it slim).
- TypeScript Ready: tsconfig.json for checks (no build needed).Infra Files:
-
.npmignore: Excludes tests/examples from NPM.
- tsconfig.json: JS + TS intellisense.
- CHANGELOG.md: Release notes.
- .editorconfig: 2-space indents everywhere.
- .eslintrc.js`: Enforces clean code.MIT License. See LICENSE.
---
β Star on GitHub if Termglow lights up your terminal! Created by DanuZz β Questions? Open an issue.