https://github.com/kwooshung/consolebadge
Output beautiful badges in the console, supporting right angles, rounded corners, color and other settings
https://github.com/kwooshung/consolebadge
badge console console-badge consoles print
Last synced: 2 months ago
JSON representation
Output beautiful badges in the console, supporting right angles, rounded corners, color and other settings
- Host: GitHub
- URL: https://github.com/kwooshung/consolebadge
- Owner: kwooshung
- License: mit
- Created: 2024-02-01T08:07:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-18T00:47:29.000Z (over 1 year ago)
- Last Synced: 2025-03-30T18:01:41.981Z (3 months ago)
- Topics: badge, console, console-badge, consoles, print
- Language: JavaScript
- Homepage:
- Size: 200 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelogs/.history
- License: LICENSE
Awesome Lists containing this project
README
# @kwooshung/console-badge






[](https://www.npmjs.com/package/@kwooshung/console-badge)
[](https://www.npmjs.com/package/@kwooshung/console-badge)
[](https://github.com/kwooshung/ConsoleBadge/actions/)
[](https://codecov.io/gh/kwooshung/ConsoleBadge)
[](https://codeclimate.com/github/kwooshung/ConsoleBadge/maintainability)
[](LICENSE)
[](https://gitee.com/kwooshung/ConsoleBadge/)
# Why Develop It?
In open source programs, there are various badges, just like the badges shown above; I hope that such badges can also be displayed in the console to facilitate the display of current program information, such as version number, build time, build status, etc. and other information.
# Why Use It?
- Supports bilingual annotations in both Chinese and English;
- Low learning cost, chain calling, simple and flexible use;
- Implemented with modern features of **ES6**;
- Written in **TypeScript** for type safety;
- Pure script, can depend on any framework, any platform, any environment;
- Supports on-demand import, `esm` modularization, natively supports **tree-shaking**, no worries about the size after packaging;
- Of course, this project also provides a `commonjs` standard `cjs` version;
- Test coverage of **100%**.# Install
## npm
```bash
npm install @kwooshung/console-badge
```## yarn
```bash
yarn add @kwooshung/console-badge
```## pnpm
```bash
pnpm add @kwooshung/console-badge
```# Usage
## Basic Usage:
```typescript
import ConsoleBadge from '@kwooshung/console-badge';const cb = new ConsoleBadge('version', 'v1.2.3');
cb.[various configuration functions, supporting chain calls].print();
```## Demo Screenshot
> Below is a demonstration of some of the functions;

## Why are the functions not listed here?
- Initially, I thought of listing them, but considering the simplicity of use and straightforward code, it's better to view the source code directly [Click here to view the source code](./src/index.ts).
- The function names are quite intuitive, so there's no need to worry about understanding them.
- If you're using TypeScript, you'll get prompts, and the comments are in both Chinese and English, making it very simple to use. There's nothing to worry about.