Gathering detailed insights and metrics for cliui
Gathering detailed insights and metrics for cliui
easily create complex multi-column command-line-interfaces.
npm install cliui
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.1
Supply Chain
99.5
Quality
88.4
Maintenance
100
Vulnerability
100
License
JavaScript (55.42%)
TypeScript (44.58%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
17,980,321,078
Last Day
17,503,162
Last Week
96,875,645
Last Month
403,724,094
Last Year
4,404,056,378
ISC License
373 Stars
134 Commits
43 Forks
10 Watchers
10 Branches
20 Contributors
Updated on Mar 17, 2025
Minified
Minified + Gzipped
Latest Version
9.0.1
Package Id
cliui@9.0.1
Unpacked Size
56.02 kB
Size
18.73 kB
File Count
7
NPM Version
6.14.18
Node Version
14.21.3
Published on
Mar 17, 2025
Cumulative downloads
Total Downloads
Last Day
0.3%
17,503,162
Compared to previous day
Last Week
1.5%
96,875,645
Compared to previous week
Last Month
3.7%
403,724,094
Compared to previous month
Last Year
12.1%
4,404,056,378
Compared to previous year
easily create complex multi-column command-line-interfaces.
1npm i cliui@latest chalk@latest
1const ui = require('cliui')() 2const {Chalk} = require('chalk'); 3const chalk = new Chalk(); 4 5ui.div('Usage: $0 [command] [options]') 6 7ui.div({ 8 text: 'Options:', 9 padding: [2, 0, 1, 0] 10}) 11 12ui.div( 13 { 14 text: "-f, --file", 15 width: 20, 16 padding: [0, 4, 0, 4] 17 }, 18 { 19 text: "the file to load." + 20 chalk.green("(if this description is long it wraps).") 21 , 22 width: 20 23 }, 24 { 25 text: chalk.red("[required]"), 26 align: 'right' 27 } 28) 29 30console.log(ui.toString())
As of v7
cliui
supports Deno and
ESM:
1import cliui from "cliui"; 2import chalk from "chalk"; 3// Deno: import cliui from "https://deno.land/x/cliui/deno.ts"; 4 5const ui = cliui({}) 6 7ui.div('Usage: $0 [command] [options]') 8 9ui.div({ 10 text: 'Options:', 11 padding: [2, 0, 1, 0] 12}) 13 14ui.div( 15 { 16 text: "-f, --file", 17 width: 20, 18 padding: [0, 4, 0, 4] 19 }, 20 { 21 text: "the file to load." + 22 chalk.green("(if this description is long it wraps).") 23 , 24 width: 20 25 }, 26 { 27 text: chalk.red("[required]"), 28 align: 'right' 29 } 30) 31 32console.log(ui.toString())
cliui exposes a simple layout DSL:
If you create a single ui.div
, passing a string rather than an
object:
\n
: characters will be interpreted as new rows.\t
: characters will be interpreted as new columns.\s
: characters will be interpreted as padding.as an example...
1var ui = require('./')({ 2 width: 60 3}) 4 5ui.div( 6 'Usage: node ./bin/foo.js\n' + 7 ' <regex>\t provide a regex\n' + 8 ' <glob>\t provide a glob\t [required]' 9) 10 11console.log(ui.toString())
will output:
1Usage: node ./bin/foo.js 2 <regex> provide a regex 3 <glob> provide a glob [required]
1cliui = require('cliui')
Specify the maximum width of the UI being generated.
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to 80
.
Enable or disable the wrapping of text in a column.
Create a row with any number of columns, a column can either be a string, or an object with the following options:
right
or center
.[top, right, bottom, left]
.Similar to div
, except the next row will be appended without
a new line being created.
Resets the UI elements of the current cliui instance, maintaining the values
set for width
and wrap
.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 3/19 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More