nstypocolors
v2.3.0
Published
Minimal color and gradient logging utilities for modern TypeScript projects.
Maintainers
Readme
nstypocolors
Minimal color and gradient logging utilities for modern TypeScript projects.
Features
- Comprehensive color support: standard, bright, pastel, and background colors
- Special gradient effects including rainbow and success animations
- Integrated CLI tool (
nstc) for direct terminal usage - Help documentation and command reference
- Persistent default color configuration
- Full TypeScript support with strong type safety
Installation
npm install nstypocolorsUsage
TypeScript/JavaScript
import { logRed, logGreen, logBlue, logSuccess } from 'nstypocolors'
logRed('This is red')
logGreen('This is green')
logBlue('This is blue')
logSuccess('Success message with gradient effect')CLI Reference
The package includes a command-line interface accessible via nstc.
Basic Syntax
nstc "Your message" --color-flagAvailable Options
| Flag | Description |
| ------------ | -------------------------- |
| --red | Red text |
| --green | Green text |
| --blue | Blue text |
| --gradient | Rainbow gradient effect |
| --success | Success gradient (default) |
| help | Display help documentation |
Help Documentation
View all available commands and options:
nstc helpDefault Color Configuration
Set a persistent default color to avoid repeatedly specifying color flags. The default color is stored locally in your home directory and applies automatically when no color option is provided.
Commands
Set Default Color
nstc setdefault <color-option>Set a default color that will be used for all messages when no color flag is provided.
Examples:
nstc setdefault --build
nstc setdefault --green
nstc setdefault --pastel-blue
nstc setdefault --successYou can replace <color-option> with any valid color flag supported by nstc.
Get Current Default
nstc getdefaultDisplay the currently configured default color.
Clear Default
nstc cleardefaultRemove the default color configuration.
Usage
Once a default is set, simply run:
nstc "Your message"The message will automatically use your configured default color. You can still override it by specifying a color flag:
nstc "Your message" --redStorage
The configuration is stored as a JSON file in your home directory (~/.nstc-config.json) and persists across terminal sessions.
Example Usage
Help Menu
Terminal Output
Available Colors
Standard: Red, Green, Pink, Yellow, Blue, Magenta, Cyan, White, Black
Bright: Bright Red, Bright Green, Bright Yellow, Bright Blue, Bright Magenta, Bright Cyan, Bright White
Pastel: Pastel Blue, Pastel Pink, Pastel Mint, Pastel Lavender, Pastel Coral, Pastel Yellow, Pastel Red, Pastel Green, Pastel Cyan, Pastel White
Background: Back Pastel Blue, Back Pastel Pink, Back Pastel Red, Back Pastel Green, Back Pastel Yellow, Back Pastel Mint, Back Pastel Coral, Back Pastel Lavender
Gradient Effects
logGradient('Rainbow gradient text')
logSuccess('Success gradient text')Community Support
For assistance or contributions, connect with the community:
Discord: https://discord.gg/vRXgWaar2G
