Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chalk/chalk-cli
Terminal string styling done right
https://github.com/chalk/chalk-cli
Last synced: 2 months ago
JSON representation
Terminal string styling done right
- Host: GitHub
- URL: https://github.com/chalk/chalk-cli
- Owner: chalk
- License: mit
- Created: 2015-07-01T00:59:41.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T16:49:53.000Z (over 1 year ago)
- Last Synced: 2024-08-23T17:38:07.938Z (3 months ago)
- Language: JavaScript
- Size: 46.9 KB
- Stars: 278
- Watchers: 10
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# chalk-cli [![Downloads](https://badgen.net/npm/dt/chalk-cli)](https://www.npmjs.com/package/chalk-cli) [![run on repl.it](https://repl.it/badge/github/chalk/chalk-cli)](https://repl.it/github/chalk/chalk-cli)
> Terminal string styling done right
## Install
```sh
npm install --global chalk-cli
```## Usage
```
$ chalk --helpUsage
$ chalk ... <string>
$ echo <string> | chalk <style> ...Options
--template, -t Style template. The `~` character negates the style.
--stdin Read input from stdin rather than from arguments.
--no-newline, -n Don't emit a newline (`\n`) after the input.
--demo Demo of all Chalk styles.Examples
$ chalk red bold 'Unicorns & Rainbows'
$ chalk -t '{red.bold Unicorns & Rainbows}'
$ chalk -t '{red.bold Dungeons and Dragons {~bold.blue (with added fairies)}}'
$ echo 'Unicorns from stdin' | chalk --stdin red bold
```See [supported styles](https://github.com/chalk/chalk#styles).
## Template syntax
- `{red.bold unicorn}`
- `{red.bold unicorns} are {blue FUN!!!}`
- `{red.bold unicorn {blue.underline dancing}}`
- `{red red {~red normal}}`
- `{red hey\} still red} not red`
- `{red hey\\} not red`## Related
- [chalk](https://github.com/chalk/chalk) - API for this module
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)