Scen
Create sections in the terminal.
+-Scen---------------------------------+
| |
| |
| The quick brown fox |
| jumps over the lazy dog. |
| |
| |
+--------------------------------------+
Installation
npm install scen
Usage
const scen = const text = 'The quick brown fox \njumps over the lazy dog.' console
API
text
The text which you want to show in section.
options
How to show text in section, possible values are as follows:
title width height style padding textAlign titleAlign marginTop marginLeft marginBottom
title
Title of section. Default is empty string.
console; /*┌─Hi there!─────┐│Hello, world! │└───────────────┘*/
width
Width of section. Default is 0
.
console; /*┌────────────────────┐│Hello, world! │└────────────────────┘*/
height
Height of section. Default is 0
.
console; /*┌─────────────┐│Hello, world!││ ││ │└─────────────┘*/
style
Style of section border. Default is single
.
You can use single
, double
, round
, single-double
, double-single
, classic
, stars
or fenced
. If you want to customize the characters, please modify the code.
console; /******************* ** Hello, world! ** *******************/
padding
Text padding in section. Default is '0'
. Use this option like CSS padding.
console; /*┌───────────────┐│ ││ ││ ││ Hello, world! ││ ││ ││ │└───────────────┘*/
textAlign
Specifies the horizontal alignment of text. Default is left
. You can use left
, center
, or right
.
console; /*┌────────────────────┐│ Hello, world!│└────────────────────┘*/
titleAlign
Specifies the horizontal alignment of section title. Default is left
. You can use left
, center
, or right
.
console; /*┌────────────Hi there!─┐│Hello, world! │└──────────────────────┘*/
marginLeft
Specifies the left offset for the section.
console; /* ┌─────────────┐ │Hello, world!| └─────────────┘*/
marginTop
Specifies the top offset for the section.
console; /* ┌─────────────┐│Hello, world!|└─────────────┘*/
marginBottom
Specifies the bottom offset for the section.
console; /*┌─────────────┐│Hello, world!|└─────────────┘ */
License
MIT