ascii-box
Utility to print boxes in the console.
Tech stack
- cli-boxes@1.0.0
- colors@1.2.1
Setup
npm install ascii-box --save
Method
box(message[, options])
Parameters
msg
stringopts
Objectopts.border
string single, double, code, round, dotted, retro, single-double, double-singleopts.color
string green, red, blue, cyan, magenta, gray, black, whiteopts.padding
numberopts.minWidth
numberopts.maxWidth
number
Usage examples
Example:
const box = box; // Defaultconsole;
+--------------------------------------------------------------------+| || Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabit || ur eleifend molestie urna a dictum. Duis suscipit ipsum eget viv || erra tincidunt. In hac habitasse platea dictumst. || |+--------------------------------------------------------------------+
Example:
const box = box; // Code boxconsole;
*************************** ** Hello ** ***************************
Example:
const box = box; // Dotted boxconsole;
......................................................................: :: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabit :: ur eleifend molestie urna a dictum. Duis suscipit ipsum eget viv :: erra tincidunt. In hac habitasse platea dictumst. :: :......................................................................
Example:
const box = box; // Retro boxconsole;
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cur ░░ abitur eleifend molestie urna a dictum. Duis suscipit ipsum ░░ eget viverra tincidunt. In hac habitasse platea dictumst. ░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Example:
const box = box; // single boxconsole;
┌────────────────────────────────────────────────────────────────┐│ ││ Lorem ipsum dolor sit amet, consectetur adipiscing elit. ││ Curabitur eleifend molestie urna a dictum. ││ │└────────────────────────────────────────────────────────────────┘
Example:
const box = box; // double-single boxconsole;
╔════════════════════════════════════════════════════════════════╗║ ║║ Lorem ipsum dolor sit amet, consectetur adipiscing elit. ║║ Curabitur eleifend molestie urna a dictum. ║║ ║╚════════════════════════════════════════════════════════════════╝
Example:
const box = box; // double-single boxconsole;
╒════════════════════════════════════════════════════════════════╕│ ││ Lorem ipsum dolor sit amet, consectetur adipiscing elit. ││ Curabitur eleifend molestie urna a dictum. ││ │╘════════════════════════════════════════════════════════════════╛
Example:
const box = box; // round boxconsole;
╭────────────────────────────────────────────────────────╮│ ││ Lorems: ││ 1. Lorem ipsum dolor sit amet, consectetur adipiscin ││ g elit. In hac habitasse platea dictumst. Ut vitae s ││ ollicitudin nulla. Duis et lorem commodo, faucibus m ││ auris varius, dignissim risus. ││ ││ 2. Vivamus porta sodales ligula, et interdum ante di ││ ctum sed. Morbi finibus scelerisque egestas. Orci va ││ rius natoque penatibus et magnis dis parturient mont ││ es, nascetur ridiculus mus. ││ ││ 3. Duis a fermentum lectus. Nam accumsan feugiat pur ││ us id cursus. Aliquam auctor consequat volutpat. Sus ││ pendisse quis feugiat neque, commodo blandit erat. ││ │╰────────────────────────────────────────────────────────╯
License
This project is licensed under the MIT License.
Contributing
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request