v0.0.2
Generate Badges for your CLI written in Deno and TS
Repository
Current version released
6 years ago
Dependencies
std
CLI Badges
Generate Badges for your CLI.
Features
- Make Beautiful Badges in CLI
- Works with all terminals
- Link support (soon)
- Variety of colors to choose from
- Written in TS with Deno
- many more coming…
Usage
import { badges } from "https://deno.land/x/cli_badges@v0.0.1/index.ts";
console.log(badges('failed', '2', {msgBg: 'red'}))
console.log(badges('success', '2', {msgBg: 'green'}))
console.log(badges('skipped', '2', {msgBg: 'yellow'}))Output

badges function
badges function accepts the following arguments:
label: label of the badgemsg: message of the badgeopts: accepts an interface ofBadgeOptions
BadgeOptions Interface
interface BadgeOptions {
msgBg: string; // default is blue
labelBg: string; // default is black
msgColor: string; // default is white
labelColor: string; // default is white
msgStyle?: string;
labelStyle?: string;
msgWidth?: number;
labelWidth?: number;
}Available Options
Foreground Colors
blackredbluegreenyellowmagentacyanwhitegray
Custom color support coming soon
Background Colors
blackredbluegreenyellowmagentacyanwhite
Custom color support coming soon
Styles
bolditalicinversedimstrikeunderline
Acknowledgments
I thank the author of nombrekeff/cli-badges for his original implementation in JS wth Node and also helped me with some Deno issues and giving me guidance on this project as this is my first project with TS.
License
Licensed under MIT.