All Projects β†’ Delta456 β†’ cli_badges

Delta456 / cli_badges

Licence: MIT license
Generate Badges for your CLI written in πŸ¦• Deno and TS

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to cli badges

deno-dex
πŸ¦• A dexterous deno executor
Stars: ✭ 19 (-5%)
Mutual labels:  deno
now-deno-example
A demo application of now-deno and deno-postgres.
Stars: ✭ 30 (+50%)
Mutual labels:  deno
deno-x-ranking
πŸ¦• Deno Third Party Modules Ranking πŸ‘‘
Stars: ✭ 28 (+40%)
Mutual labels:  deno
carol
A Deno port of carlo
Stars: ✭ 63 (+215%)
Mutual labels:  deno
mock
Utilities to help mock behavior, spy on function calls, stub methods, and fake time for tests.
Stars: ✭ 31 (+55%)
Mutual labels:  deno
prettyBenching
πŸ¦• A small lib to make your Deno benchmarking progress and results look pretty
Stars: ✭ 23 (+15%)
Mutual labels:  deno
deno sass
πŸš€ Cute Sass compiler bindings to Deno.
Stars: ✭ 13 (-35%)
Mutual labels:  deno
deno-canvas
Canvas API for Deno, ported from canvaskit-wasm (Skia).
Stars: ✭ 124 (+520%)
Mutual labels:  deno
azure-webapps-deno-deploy
A GitHub Action for deploying Deno πŸ¦• web apps to Azure ☁️
Stars: ✭ 27 (+35%)
Mutual labels:  deno
scuttlesaurus
retog.github.io/scuttlesaurus/
Stars: ✭ 21 (+5%)
Mutual labels:  deno
Rishit-dagli
My GitHub profile README
Stars: ✭ 50 (+150%)
Mutual labels:  badges
EventSource
EventSource in Deno
Stars: ✭ 18 (-10%)
Mutual labels:  deno
slack-web-api
Simple, convenient, and configurable HTTP client for making requests to Slack’s Web API. Deno port of @slack/web-api
Stars: ✭ 16 (-20%)
Mutual labels:  deno
awesome-shields
The list of styled dynamic informational shields, given the ability to exist by the truly amazing work of shields.io 😍
Stars: ✭ 89 (+345%)
Mutual labels:  badges
deno deploy versailles
凑尔衛语录(ιƒ¨η½²εœ¨ Deno Deploy)
Stars: ✭ 18 (-10%)
Mutual labels:  deno
http compression
πŸ—œοΈ Deno HTTP compression middleware
Stars: ✭ 34 (+70%)
Mutual labels:  deno
hatcher
🐣 Registries toolbox & update notifications for your CLI
Stars: ✭ 14 (-30%)
Mutual labels:  deno
generator-node
πŸ”§ Yeoman generator for Node projects.
Stars: ✭ 16 (-20%)
Mutual labels:  badges
deno desktop
Windowing support for Deno WebGPU.
Stars: ✭ 49 (+145%)
Mutual labels:  deno
ssvm-deno-starter
A template project to run Rust functions in Deno through the Second State WebAssembly engine.
Stars: ✭ 50 (+150%)
Mutual labels:  deno

CLI Badges

Generate Badges for your CLI.

deno land deno version GitHub release CI

NOTE: It is recommended to update pre-exisiting versions of this module to ^v0.1.0 as there are many breaking changes from this release in the API.

Features

  • Make Beautiful Badges for CLI 🀩
  • Works across all terminals πŸ¦„
  • Link support πŸ”—
  • Variety of colors to choose from 🎨
  • Written in TS with Deno πŸ¦•

Warning ⚠️: If your terminal has a custom theme then the colors will blend according to your configuration which can cause unwanted results.

Usage

Simple Example

Showcases failed, success and skipped badge on the terminal

import { badge } from "https://deno.land/x/[email protected]/mod.ts";

console.log(badge("failed", "2", { msgBg: "red" }));

console.log(badge("success", "2", { msgBg: "green" }));

console.log(badge("skipped", "2", { msgBg: "yellow" }));

sample_output

Hyperlink Example

The hyperlink will only work if supported.

import { badge } from "https://deno.land/x/[email protected]/mod.ts";

console.log(badge('❀️ donate', 'ko-fi', { hyper_link: 'https://ko-fi.com/logginjs',
}));

donate_output

For more usages, see examples.

badge function

badge function accepts the following arguments:

  • label: label of the badge
  • msg: message of the badge
  • opts: accepts an interface of BadgeOptions

BadgeOptions Interface

interface BadgeOptions {
  msgBg: string; // default is blue
  labelBg: string; // default is brightBlack
  msgColor: string; // default is white
  labelColor: string; // default is white
  msgStyle?: string; // default is null
  labelStyle?: string; // default is null
  msgWidth?: number; // default is msg length + 2
  labelWidth?: number; // default is label length + 2
  is_8bit?: boolean; // default is false as it uses 24 bits
  hyper_link?: string; // hyperlink for the badge
}

Available Options

Foreground Colors

  • black
  • red
  • blue
  • green
  • yellow
  • magenta
  • cyan
  • white
  • brightBlack
  • brightRed
  • brightBlue
  • brightGreen
  • brightYellow
  • brightMagenta
  • brightCyan
  • brightWhite

Background Colors

  • black
  • red
  • blue
  • green
  • yellow
  • magenta
  • cyan
  • white
  • brightBlack
  • brightRed
  • brightBlue
  • brightGreen
  • brightYellow
  • brightMagenta
  • brightCyan
  • brightWhite

Custom Colors

Custom Colors are available and can be used for msgBg, labelmsg, msgColor and labelColor only. There are options to make 8 bit and 24 bit colors respectively. Set is_8bit to true if you want custom 8 bit RGB colors else it will be set to 24 bit RBG colors by default.

NOTE: 24 bit Colors must be in a range of 0x000000 and 0xffffff and 8 bit Colors must in a range of 0x0 and 0xFF.

Styles

  • bold
  • italic
  • inverse
  • dim
  • strike
  • underline

Hyperlink Support

Hyperlink is only supported on some terminals.

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 written in TS and Deno.

License

Licensed under MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].