Introduction
Welcome to the documentation for ts-better-consoleWhat is ts-better-console?
ts-better-console is a TypeScript library for building rich terminal interfaces. Beyond styled logging, it ships with interactive components — buttons, menus, progress bars, spinners, cards, inputs — plus helpers for timestamps, debug flags, clickable links, and more.
Why use ts-better-console?
Plain console.log works fine for quick debugging, but it falls flat when you need structured output, colored log levels, or anything interactive. ts-better-console gives you all of that without pulling in a dozen separate packages. Everything is typed, tree-shakable, and works with both Node and Bun.
Highlights
- Styled logging with
log,warn,error,info,debug, andjson - Interactive components:
ButtonGroup,Menu,Progress,Spinner,Input - Visual components:
Cardwith border styles,linkfor clickable URLs - Utility functions:
sfor styling,csfor joining strings,ts/flag/tsflagfor timestamps and log levels - Works with Node.js and Bun out of the box
Getting Started
Head over to the quick start guide to install the package and write your first styled log in under a minute.
Community
We welcome contributions from the community! If you have any ideas, suggestions, or want to report a bug, please feel free to open an issue or submit a pull request on our Discord server.
License
ts-better-console is licensed under the MIT License. See the MIT License.
Want to support this project?
If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.
Want to contribute to this project?
Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!