Package Exports
- cliui
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cliui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
cliui
easily create complex multi-column command-line-interfaces.
Example
var ui = require('cliui')({
width: 80
})
ui.div('Usage: $0 [command] [options]')
ui.div({
text: 'Options:',
padding: [2, 0, 2, 0]
})
ui.div(
{
text: "-f, --file",
width: 40,
padding: [0, 4, 0, 4]
},
{
text: "the file to load",
width: 25
},
{
text: "[required]",
align: 'right'
}
)
console.log(ui.toString())
Methods
cliui = require('cliui')
cliui({width: integer})
Specify the maximum width of the UI being generated.
cliui({wrap: boolean})
Enable or disable the wrapping of text in a column.
cliui.div(column, column, column)
Create a row with any number of columns, a column can either be a string, or an object with the following options:
- width: the width of a column.
- align: alignment,
right
orcenter
. - padding:
[top, right, bottom, left]
.
cliui.span(column, column, column)
Similar to div
, except the next row will be appended without
a new line being created.