Comparing version
{ | ||
"name": "ansis", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Formatting text in terminal with ANSI colors & styles.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -157,21 +157,21 @@ <div align="center"> | ||
| Foreground colors | Background colors | Styles | | ||
|:----------------------|:------------------|-------------------------------------------------------------| | ||
| `black` | `bgBlack` | **`bold`** | | ||
| `red` | `bgRed` | `dim` (alias`faint`) | | ||
| `green` | `bgGreen` | _`italic`_ | | ||
| `yellow` | `bgYellow` | `underline` U̲n̲d̲e̲r̲l̲i̲n̲e̲ | | ||
| `blue` | `bgBlue` | `doubleUnderline` D̳o̳u̳b̳l̳e̳ ̳u̳n̳d̳e̳r̳l̳i̳n̳e̳ | | ||
| `magenta` | `bgMagenta` | `overline` O̅v̅e̅r̅l̅i̅n̅e̅ | | ||
| `cyan` | `bgCyan` | `strikethrough` (alias `strike`) S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ | | ||
| `white` | `bgWhite` | `frame` | | ||
| `gray` (alias `grey`) | `bgGray` | `encircle` | | ||
| `blackBright` | `bgBlackBright` | `inverse` | | ||
| `redBright` | `bgRedBright` | `visible` | | ||
| `greenBright` | `bgGreenBright` | `hidden` | | ||
| `yellowBright` | `bgYellowBright` | `reset` | | ||
| `blueBright` | `bgBlueBright` | | | ||
| `magentaBright` | `bgMagentaBright` | | | ||
| `cyanBright` | `bgCyanBright` | | | ||
| `whiteBright` | `bgWhiteBright` | | | ||
| Foreground colors | Background colors | Styles | | ||
|:----------------------|:------------------|--------------------------------------------| | ||
| `black` | `bgBlack` | `dim` (alias`faint`) | | ||
| `red` | `bgRed` | **`bold`** | | ||
| `green` | `bgGreen` | _`italic`_ | | ||
| `yellow` | `bgYellow` | <u>`underline`</u> | | ||
| `blue` | `bgBlue` | <s>`strikethrough`</s> (alias `strike`) | | ||
| `magenta` | `bgMagenta` | `doubleUnderline` (_not widely supported_) | | ||
| `cyan` | `bgCyan` | `overline` (_not widely supported_) | | ||
| `white` | `bgWhite` | `frame` (_not widely supported_) | | ||
| `gray` (alias `grey`) | `bgGray` | `encircle` (_not widely supported_) | | ||
| `blackBright` | `bgBlackBright` | `inverse` | | ||
| `redBright` | `bgRedBright` | `visible` | | ||
| `greenBright` | `bgGreenBright` | `hidden` | | ||
| `yellowBright` | `bgYellowBright` | `reset` | | ||
| `blueBright` | `bgBlueBright` | | | ||
| `magentaBright` | `bgMagentaBright` | | | ||
| `cyanBright` | `bgCyanBright` | | | ||
| `whiteBright` | `bgWhiteBright` | | | ||
@@ -221,7 +221,10 @@ | ||
Foreground: `.ansi256(code)` has aliases `.ansi(code)` and `.fg(code)`\ | ||
Background: `.bgAnsi256(code)` has aliases `.bgAnsi(code)` and `.bg(code)` | ||
The pre-defined set of 256 colors. | ||
<div align="center"> | ||
<a href="https://www.npmjs.com/package/ansis"> | ||
<img width="830" src="docs/img/ansi256.png" alt="ANSI 256 colors"> | ||
</a> | ||
</div> | ||
| Code range | Description | | ||
@@ -234,2 +237,5 @@ |-----------:|-------------------------------------------| | ||
Foreground function: `.ansi(code)` has aliases `.ansi256(code)` and `.fg(code)`\ | ||
Background function: `.bgAnsi(code)` has aliases `.ansi256(code)` and `.bg(code)` | ||
See [ANSI color codes](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit). | ||
@@ -239,8 +245,10 @@ | ||
// foreground color | ||
ansis.ansi256(96).bold('bold Bright Cyan'); | ||
ansis.fg(96).bold('bold Bright Cyan'); // `fg` is the short alias for `ansi256` | ||
ansis.ansi(96).bold('bold Bright Cyan'); | ||
ansis.ansi256(96).bold('bold Bright Cyan'); // `ansi256` is the alias for `ansi` | ||
ansis.fg(96).bold('bold Bright Cyan'); // `fg` is the short alias for `ansi` | ||
// background color | ||
ansis.bgAnsi256(105)('Bright Magenta'); | ||
ansis.bg(105)('Bright Magenta'); // `bg` is the short alias for `bgAnsi256` | ||
ansis.bgAnsi(105)('Bright Magenta'); | ||
ansis.bgAnsi256(105)('Bright Magenta'); // `bgAnsi256` is the alias for `bgAnsi` | ||
ansis.bg(105)('Bright Magenta'); // `bg` is the short alias for `bgAnsi` | ||
``` | ||
@@ -336,4 +344,4 @@ | ||
``` | ||
$ node example.js #=> color output | ||
$ node example.js > log.txt #=> no color output | ||
$ node example.js #=> color | ||
$ node example.js > log.txt #=> no color | ||
``` | ||
@@ -353,3 +361,3 @@ | ||
> The value is not important, see standard description by [NO_COLOR](https://no-color.org/).\ | ||
> `NO_COLOR=1` `NO_COLOR=0` `NO_COLOR=true` `NO_COLOR=false` disable colors\ | ||
> `NO_COLOR=1` `NO_COLOR=true` disable colors | ||
> | ||
@@ -373,5 +381,5 @@ > The `FORCE_COLOR` variable should be presents with one of values:\ | ||
``` | ||
$ ./example.js #=> colors | ||
$ ./example.js --no-color #=> no colors | ||
$ ./example.js --color=false #=> no colors | ||
$ ./example.js #=> color | ||
$ ./example.js --no-color #=> no color | ||
$ ./example.js --color=false #=> no color | ||
@@ -403,3 +411,3 @@ $ ./example.js > log.txt #=> no color | ||
> **Code size**\ | ||
> The size of distributed code that will be loaded into your app. | ||
> The size of distributed code that will be loaded via `require` or `import` into your app. It's not a package size. | ||
> | ||
@@ -412,3 +420,3 @@ > **Named import**\ | ||
> **Chained syntax**\ | ||
`> lib.red.bold('text')` | ||
> `lib.red.bold('text')` | ||
> | ||
@@ -415,0 +423,0 @@ > **Nested template strings**\ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
656
1.23%40914
-0.1%