Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
sys-repo/sysWorks with
•JSR Score100%•This package works with Deno, Browsers

License
•MIT
Downloads71/wk
•Published2 weeks ago (0.0.315)
Tools for working with a command-line interfaces.
Command Line Interface
Tools for working with a command-line interfaces (cli).
- Ansi colors
- Table formatting
- Prompting (user input)
Example
import { Cli, c } from '@sys/cli'; /** * Ansi colors: */ console.info(c.cyan('using color')); /** * string: plain → ansi → plain: */ const text = `thing ${c.green('with')} color`; const stripped = Cli.stripAnsi(text); /** * Table formatting: */ const table = Cli.table([]); table.push(['foo', 'bar']); console.info(table.toString().trim()) /** * Prompting: */ const dirname = await Cli.Input.Text.prompt({ message: 'Folder Name', default: 'foo', // Keep folder-name simple + safe: letters, numbers, dot, dash, underscore, slashes (no spaces). validate: (v: string) => /^[\w.\-\/]+$/.test(v) || 'Use letters, numbers, ".", "-", "_" (and optional "/")', });
Built and signed on
GitHub Actions
Add Package
deno add jsr:@sys/cli
Import symbol
import * as cli from "@sys/cli";
Import directly with a jsr specifier
import * as cli from "jsr:@sys/cli";