\href{https://travis-ci.org/yargs/cliui}{\texttt{ }} \href{https://coveralls.io/r/yargs/cliui?branch=}{\texttt{ }} \href{https://www.npmjs.com/package/cliui}{\texttt{ }} \href{https://github.com/conventional-changelog/standard-version}{\texttt{ }}

easily create complex multi-\/column command-\/line-\/interfaces.\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5249}{}\doxysection{Example}\label{md_sfcode_node_modules_cliui_README_autotoc_md5249}

\begin{DoxyCode}{0}
\DoxyCodeLine{var ui = require('cliui')()}
\DoxyCodeLine{}
\DoxyCodeLine{ui.div('Usage: \$0 [command] [options]')}
\DoxyCodeLine{}
\DoxyCodeLine{ui.div(\{}
\DoxyCodeLine{  text: 'Options:',}
\DoxyCodeLine{  padding: [2, 0, 2, 0]}
\DoxyCodeLine{\})}
\DoxyCodeLine{}
\DoxyCodeLine{ui.div(}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    text: "{}-\/f, -\/-\/file"{},}
\DoxyCodeLine{    width: 20,}
\DoxyCodeLine{    padding: [0, 4, 0, 4]}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    text: "{}the file to load."{} +}
\DoxyCodeLine{      chalk.green("{}(if this description is long it wraps)."{})}
\DoxyCodeLine{    ,}
\DoxyCodeLine{    width: 20}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    text: chalk.red("{}[required]"{}),}
\DoxyCodeLine{    align: 'right'}
\DoxyCodeLine{  \}}
\DoxyCodeLine{)}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(ui.toString()) }

\end{DoxyCode}


\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5250}{}\doxysection{Layout DSL}\label{md_sfcode_node_modules_cliui_README_autotoc_md5250}
cliui exposes a simple layout DSL\+:

If you create a single {\ttfamily ui.\+div}, passing a string rather than an object\+:


\begin{DoxyItemize}
\item {\ttfamily \textbackslash{}n}\+: characters will be interpreted as new rows.
\item {\ttfamily \textbackslash{}t}\+: characters will be interpreted as new columns.
\item {\ttfamily \textbackslash{}s}\+: characters will be interpreted as padding.
\end{DoxyItemize}

{\bfseries{as an example...}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var ui = require('./')(\{}
\DoxyCodeLine{  width: 60}
\DoxyCodeLine{\})}
\DoxyCodeLine{}
\DoxyCodeLine{ui.div(}
\DoxyCodeLine{  'Usage: node ./bin/foo.js\(\backslash\)n' +}
\DoxyCodeLine{  '  <regex>\(\backslash\)t  provide a regex\(\backslash\)n' +}
\DoxyCodeLine{  '  <glob>\(\backslash\)t  provide a glob\(\backslash\)t [required]'}
\DoxyCodeLine{)}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(ui.toString()) }

\end{DoxyCode}


{\bfseries{will output\+:}}


\begin{DoxyCode}{0}
\DoxyCodeLine{Usage: node ./bin/foo.js}
\DoxyCodeLine{  <regex>  provide a regex}
\DoxyCodeLine{  <glob>   provide a glob          [required] }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5251}{}\doxysection{Methods}\label{md_sfcode_node_modules_cliui_README_autotoc_md5251}

\begin{DoxyCode}{0}
\DoxyCodeLine{cliui = require('cliui') }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5252}{}\doxysubsection{cliui(\{width\+: integer\})}\label{md_sfcode_node_modules_cliui_README_autotoc_md5252}
Specify the maximum width of the UI being generated. If no width is provided, cliui will try to get the current window\textquotesingle{}s width and use it, and if that doesn\textquotesingle{}t work, width will be set to {\ttfamily 80}.\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5253}{}\doxysubsection{cliui(\{wrap\+: boolean\})}\label{md_sfcode_node_modules_cliui_README_autotoc_md5253}
Enable or disable the wrapping of text in a column.\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5254}{}\doxysubsection{cliui.\+div(column, column, column)}\label{md_sfcode_node_modules_cliui_README_autotoc_md5254}
Create a row with any number of columns, a column can either be a string, or an object with the following options\+:


\begin{DoxyItemize}
\item {\bfseries{text\+:}} some text to place in the column.
\item {\bfseries{width\+:}} the width of a column.
\item {\bfseries{align\+:}} alignment, {\ttfamily right} or {\ttfamily center}.
\item {\bfseries{padding\+:}} {\ttfamily \mbox{[}top, right, bottom, left\mbox{]}}.
\item {\bfseries{border\+:}} should a border be placed around the div?
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5255}{}\doxysubsection{cliui.\+span(column, column, column)}\label{md_sfcode_node_modules_cliui_README_autotoc_md5255}
Similar to {\ttfamily div}, except the next row will be appended without a new line being created.\hypertarget{md_sfcode_node_modules_cliui_README_autotoc_md5256}{}\doxysubsection{cliui.\+reset\+Output()}\label{md_sfcode_node_modules_cliui_README_autotoc_md5256}
Resets the UI elements of the current cliui instance, maintaining the values set for {\ttfamily width} and {\ttfamily wrap}. 