Terminal Tast
PAD
TAST accepts appropriate objects as part of it. The most simple is the Pad object. It adds text padding to its content so it can be aligned. The property children of the Pad object defines the content to be aligned. The children itself is another TAST, which is an array with the appropriate fields.
Name |
Type |
Description |
---|---|---|
type | "Pad" | Defines the type of the object. Mandatory. |
width | number | The total minimal number of characters that the resulting text must occupy. Mandatory. |
children | array | TAST of nodes to be padded. Mandatory. |
alignment | "left" | "right" | "center" | Align text inside the given width to that direction. Default: "left". |
character | string | A single character that will be used to pad the value. Default: "space". |
Simple padding
By default pad aligns the content to the left and uses spaces to pad. Use the width to ensure the minimal number of characters that it must have. Mix strings and the Pad object inside the array if necessary.

Creates name and address lines.
tast.json
[
{ "type": "Pad", "width": 10, "children": ["Name:"] },
"David.\n",
{ "type": "Pad", "width": 10, "children": ["Address:"] },
"Litoral Avenue.\n"
]
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}
Padding character
Change the padding character with the character property. It fills the space repeating the specified character.

Pads the name and address lines with dot characters.
tast.json
[
{ "type": "Pad", "width": 10, "character": "·", "children": ["Name:"] },
"David.\n",
{ "type": "Pad", "width": 10, "character": "·", "children": ["Address:"] },
"Litoral Avenue.\n"
]
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}
Note that if you use more than one character as character property, the result is unexpected.

tast.json
[{ "type": "Pad", "width": 10, "character": "morethanone", "children": ["Name:"] }, "David.\n"]
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}
Alignments
Use the padding alignment property to change the alignment. The default value is 'left'; other options are 'right' and 'center.

Left, center, and right aligned lines with character padding.
tast.json
[
{ "type": "Pad", "width": 30, "character": "·", "alignment": "left", "children": ["left"] },
"\n",
{ "type": "Pad", "width": 30, "character": "·", "alignment": "center", "children": ["center"] },
"\n",
{ "type": "Pad", "width": 30, "character": "·", "alignment": "right", "children": ["right"] },
"\n"
]
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}
Nesting
Pad children property is any valid test TAST. It allows create Pads inside Pads.

Creates an amount nested in asterisks.
tast.json
[
{
"type": "Pad",
"width": 40,
"character": "*",
"alignment": "center",
"children": [
{ "type": "Pad", "width": 7, "character": "$", "alignment": "right", "children": ["836"] },
".",
{ "type": "Pad", "width": 4, "character": "0", "alignment": "left", "children": ["99"] }
]
}
]
package.json
{
"name": "example",
"version": "1.0.0",
"orion": {
"dispatchersHelper": {
"actionCreators": {
"consumes": {
"@orion/terminals": [
"createTerminal",
"spliceTerminalTAST"
]
}
}
}
}
}