Chalk 5 is ESM. If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now. Chalk comes with an easy to use composable API where you just chain and nest the styles you want. Chain styles and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that chalk.red.yellow.green is equivalent to chalk.green. Color support is automatically detected, but you can override it by setting the level property. You should however only do this in your own code as it applies globally to all Chalk consumers. Detect whether the terminal supports color. Used internally and handled for you, but exposed for convenience. chalkStderr contains a separate instance configured with color support detected for stderr stream instead of stdout. Override rules from supportsColor apply to this too. supportsColorStderr is exposed for convenience.

Features

  • Expressive API
  • Highly performant
  • No dependencies
  • Ability to nest styles
  • Auto-detects color support
  • 256/Truecolor color support

Project Samples

Project Activity

See All Activity >

Categories

Terminals, Design

License

MIT License

Follow Chalk

Chalk Web Site

Other Useful Business Software
Forever Free Full-Stack Observability | Grafana Cloud Icon
Forever Free Full-Stack Observability | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Chalk!

Additional Project Details

Operating Systems

Windows

Programming Language

JavaScript

Related Categories

JavaScript Terminals, JavaScript Design Software

Registered

2022-05-11