FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

Console Pretty

v0.2.5 Public

CommandBox Console Pretty

Simple module to draw bordered message boxes to the console (Supports emoji!!)

Installation

CommandBox> install ConsolePretty

Usage

getInstance( "[email protected]" ).printMessageBox( message );

ConsolePretty is a threadsafe singleton and suitable for injection. Inject the library like so:

component {
  property name="ConsolePretty" inject="[email protected];
  
  function run() {
    ConsolePretty.printMessageBox( "🦄   Welcome to my pretty box  🦄 " )
  }
}

Options

  • message: String or array of strings to print inside the box. Word wrapping is on by default. If an array of strings, each item in the array will be a separate line (hint: even empty strings ). Can use some emojis (depending on terminal shell support, but mostly these are good: https://gist.github.com/rxaviers/7360908)
  • border: Character(s) to use to draw the box. Defaults to "🔥 ". Can be pretty much any printable character supported by your terminal - results may vary.
  • color: Color of text inside the box. Defaults to "white"
  • borderColor: Color of border characters. Defaults to "red"
  • wordwrap: If true, will wrap at 80 characters (or whatever columns is set to. Defaults to true.
  • columns: Number of characters to print before wrapping. Defaults to 80.

Install this module and inject it into your command/task/module CFC. Then call it like ConsolePretty.printMessageBox( message )

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
0.2.5 Jan 31 2020 03:17 PM Jan 31 2020 03:17 PM
Version History
0.2.5 Jan 31 2020 03:17 PM Jan 31 2020 03:17 PM
0.2.4 Jan 31 2020 03:12 PM Jan 31 2020 03:12 PM
0.2.3 Jan 31 2020 03:10 PM Jan 31 2020 03:10 PM
0.2.2 Jan 31 2020 03:08 PM Jan 31 2020 03:08 PM
0.2.1 Jan 31 2020 02:52 PM Jan 31 2020 02:52 PM
0.2.0 Jan 31 2020 12:00 PM Jan 31 2020 12:00 PM

 

$ box install ConsolePretty

No collaborators yet.
     
  • Jan 31 2020 11:59 AM
  • Jan 31 2020 03:17 PM
  • 259
  • 0
  • 86