Skip to content

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:

License

Notifications You must be signed in to change notification settings

alvarezmauro/styled-printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 accepts 3 extra options + value:

Option Description Values
-s | --style Text formatting normal | bold | dim | italics | underline |
blink | reverse | hidden | password
-c | --color Text color default | 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-color Background color default | 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"

styled-printf output: text 'This text is bold, red and has a blue background' in blue color, bold and yellow background

About

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:

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages