3 [![Build Status](https://travis-ci.org/bcoe/cliui.png)](https://travis-ci.org/bcoe/cliui)
4 [![Coverage Status](https://coveralls.io/repos/bcoe/cliui/badge.svg?branch=)](https://coveralls.io/r/bcoe/cliui?branch=)
5 [![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui)
7 easily create complex multi-column command-line-interfaces.
12 var ui = require('cliui')({
16 ui.div('Usage: $0 [command] [options]')
30 text: "the file to load",
39 console.log(ui.toString())
44 cliui exposes a simple layout DSL:
46 If you create a single `ui.row`, passing a string rather than an
49 * `\n`: characters will be interpreted as new rows.
50 * `\t`: characters will be interpreted as new columns.
51 * ` `: characters will be interpreted as padding.
56 var ui = require('./')({
61 'Usage: node ./bin/foo.js\n' +
62 ' <regex>\t provide a regex\n' +
63 ' <glob>\t provide a glob\t [required]'
66 console.log(ui.toString())
72 Usage: node ./bin/foo.js
73 <regex> provide a regex
74 <glob> provide a glob [required]
80 cliui = require('cliui')
83 ### cliui({width: integer})
85 Specify the maximum width of the UI being generated.
87 ### cliui({wrap: boolean})
89 Enable or disable the wrapping of text in a column.
91 ### cliui.div(column, column, column)
93 Create a row with any number of columns, a column
94 can either be a string, or an object with the following
97 * **width:** the width of a column.
98 * **align:** alignment, `right` or `center`.
99 * **padding:** `[top, right, bottom, left]`.
101 ### cliui.span(column, column, column)
103 Similar to `div`, except the next row will be appended without
104 a new line being created.