Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Dec 21, 2023 via pnpm

cliui 7.0.3

easily create complex multi-column command-line-interfaces
Package summary
Share
0
issues
0
licenses
Package created
20 Apr 2015
Version published
16 Oct 2020
Maintainers
2
Total deps
0
Direct deps
0
License
ISC

Issues

0
This package has no issues

Frequently Asked Questions

What does cliui do?

Cliui is a Node.js package designed to easily create complex multi-column command-line-interfaces. It provides a simple and effective way to manage the layout of your command-line tool's UI, including creating rows with multiple columns, manipulating text width and alignment, and even managing padding and bordering. It exposes a simple layout DSL for column and row creation and supports the interpretation of '\n', '\t', and '\s' characters as new rows, new columns, and padding, respectively.

How do you use cliui?

To utilize cliui, begin by installing it via npm:

npm install cliui

Then, in your JavaScript file, require it and create a new instance:

const ui = require('cliui')()

Next, you can start building your interface using the div method:

ui.div('Usage: $0 [command] [options]')

You can then create multiple columns inside your row using object objects:

ui.div(
  {
    text: "-f, --file",
    width: 20,
    padding: [0, 4, 0, 4]
  },
  {
    text: "the file to load."
  },
  {
    text: "required",
    align: 'right'
  }
)

Finally, output the UI as a string to display it:

console.log(ui.toString())

For a full reference of the available functions and their usage, look at the Methods Section in the readme.

Where are the cliui docs?

The cliui documentation is available directly within the readme file of the official GitHub repository, https://github.com/yargs/cliui. Here, you'll find detailed usage examples, method explanations, different object options for text width, padding, and alignment manipulation, and much more. Follow the link to access and learn more about effectively utilizing cliui in your projects.