1.1.0 • Published 3 years ago

styled-printf v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

styled-printf

Hex.pm npm

Do you want to add some styles 🎨 to the output of your bash printf commands? Use this custom script and make the output of that printf look fanzy :bowtie:

How install

Using Yarn

yarn add styled-printf

Using NPM:

npm i styled-printf

How to use

The styled-printf command is like printf (in fact it's a function wrapping printf) that allows you to easily set the text styling, color and background color for the output.

Usage:

styled-printf [-s <text format>] [--style <text format>]
  [-c <color>] [--color <color>]
  [-b <color>] [-background-color <color>]
  format [argument]

Options:

OptionDescriptionValues
-s | --styleText formattingnormal | bold | dim | italics | underline | blink | reverse | hidden | password
-c | --colorText colordefault | white | black | red | green | yellow | blue | magenta | cyan | gray | light-red | light-green | light-yellow | light-blue | light-magenta | light-cyan | light-gray | or a number between0 and 256
-b | --background-colorBackground colordefault | white | black | red | green | yellow | blue | magenta | cyan | gray | light-red | light-green | light-yellow | light-blue | light-magenta | light-cyan | light-gray | or a number between0 and 256

Example

styled-printf -s bold -c blue -b yellow "%s\n" "This text is bold, red and has a blue background"

Other flags:

-h | --helpDisplay the help documentation
-t | --testTest all the different styles in your bash terminal