Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - sindresorhus/figures: Unicode symbols with fallbacks for older terminals

Unicode symbols with fallbacks for older terminals - sindresorhus/figures

Visit SiteGitHub - sindresorhus/figures: Unicode symbols with fallbacks for older terminals

GitHub - sindresorhus/figures: Unicode symbols with fallbacks for older terminals

Unicode symbols with fallbacks for older terminals - sindresorhus/figures

Powered by 0x5a.live šŸ’—

figures

Unicode symbols with fallbacks for older terminals

and more...

Terminals such as Windows Console Host (and CMD) only support a limited character set.

Install

npm install figures

Usage

import figures, {mainSymbols, fallbackSymbols, replaceSymbols} from 'figures';

console.log(figures.tick);
// On terminals with Unicode symbols:  āœ”
// On other terminals:                 āˆš

console.log(mainSymbols.tick);
// On all terminals:  āœ”

console.log(fallbackSymbols.tick);
// On all terminals:  āˆš

console.log(replaceSymbols('āœ” check'));
// On terminals with Unicode symbols:  āœ” check
// On other terminals:                 āˆš check

API

figures (default export)

Type: object

Symbols to use on any terminal.

mainSymbols

Symbols to use when the terminal supports Unicode symbols.

fallbackSymbols

Symbols to use when the terminal does not support Unicode symbols.

replaceSymbols(string, options?)

Returns the input with replaced fallback symbols if the terminal has poor Unicode support.

All the below figures are attached to the default export as shown in the example above.

string

Type: string

String where the Unicode symbols will be replaced with fallback symbols depending on the terminal.

options

Type: object

useFallback

Type: boolean
Default: true if the terminal has poor Unicode support

Whether to replace symbols with fallbacks.

This can be set to true to always use fallback symbols, whether the terminal has poor Unicode support or not.

import {replaceSymbols} from 'figures';

console.log(replaceSymbols('āœ” check', {useFallback: true}));
// On terminals with Unicode symbols:  āˆš check
// On other terminals:                 āˆš check

Figures

Fallback characters are only shown when they differ from the Main ones.

Name Main Fallback
tick āœ” āˆš
info ā„¹ i
warning āš  ā€¼
cross āœ˜ Ɨ
square ā–ˆ
squareSmall ā—» ā–”
squareSmallFilled ā—¼ ā– 
squareDarkShade ā–“
squareMediumShade ā–’
squareLightShade ā–‘
squareTop ā–€
squareBottom ā–„
squareLeft ā–Œ
squareRight ā–
squareCenter ā– 
circle ā—Æ ( )
circleFilled ā—‰ (*)
circleDotted ā—Œ ( )
circleDouble ā—Ž ( )
circleCircle ā“ž (ā—‹)
circleCross ā“§ (Ɨ)
circlePipe ā’¾ (ā”‚)
circleQuestionMark ?āƒ (?)
radioOn ā—‰ (*)
radioOff ā—Æ ( )
checkboxOn ā˜’ [Ɨ]
checkboxOff ā˜ [ ]
checkboxCircleOn ā“§ (Ɨ)
checkboxCircleOff ā’¾ ( )
questionMarkPrefix ?āƒ ļ¼Ÿ
bullet ā—
dot ā€¤
ellipsis ā€¦
pointer āÆ >
pointerSmall ā€ŗ ā€ŗ
triangleUp ā–²
triangleUpSmall ā–“
triangleUpOutline ā–³ āˆ†
triangleDown ā–¼
triangleDownSmall ā–¾
triangleLeft ā—€ ā—„
triangleLeftSmall ā—‚
triangleRight ā–¶ ā–ŗ
triangleRightSmall ā–ø
lozenge ā—† ā™¦
lozengeOutline ā—‡ ā—Š
home āŒ‚
hamburger ā˜° ā‰”
smiley ć‹” ā˜ŗ
mustache ą·“ ā”Œā”€ā”
heart ā™„
star ā˜… āœ¶
play ā–¶ ā–ŗ
musicNote ā™Ŗ
musicNoteBeamed ā™«
nodejs ā¬¢ ā™¦
arrowUp ā†‘
arrowDown ā†“
arrowLeft ā†
arrowRight ā†’
arrowLeftRight ā†”
arrowUpDown ā†•
almostEqual ā‰ˆ
notEqual ā‰ 
lessOrEqual ā‰¤
greaterOrEqual ā‰„
identical ā‰”
infinity āˆž
subscriptZero ā‚€
subscriptOne ā‚
subscriptTwo ā‚‚
subscriptThree ā‚ƒ
subscriptFour ā‚„
subscriptFive ā‚…
subscriptSix ā‚†
subscriptSeven ā‚‡
subscriptEight ā‚ˆ
subscriptNine ā‚‰
oneHalf Ā½
oneThird ā…“
oneQuarter Ā¼
oneFifth ā…•
oneSixth ā…™
oneSeventh ā… 1/7
oneEighth ā…›
oneNinth ā…‘ 1/9
oneTenth ā…’ 1/10
twoThirds ā…”
twoFifths ā…–
threeQuarters Ā¾
threeFifths ā…—
threeEighths ā…œ
fourFifths ā…˜
fiveSixths ā…š
fiveEighths ā…
sevenEighths ā…ž
line ā”€
lineBold ā”
lineDouble ā•
lineDashed0 ā”„
lineDashed1 ā”…
lineDashed2 ā”ˆ
lineDashed3 ā”‰
lineDashed4 ā•Œ
lineDashed5 ā•
lineDashed6 ā•“
lineDashed7 ā•¶
lineDashed8 ā•ø
lineDashed9 ā•ŗ
lineDashed10 ā•¼
lineDashed11 ā•¾
lineDashed12 āˆ’
lineDashed13 ā€“
lineDashed14 ā€
lineDashed15 āƒ
lineVertical ā”‚
lineVerticalBold ā”ƒ
lineVerticalDouble ā•‘
lineVerticalDashed0 ā”†
lineVerticalDashed1 ā”‡
lineVerticalDashed2 ā”Š
lineVerticalDashed3 ā”‹
lineVerticalDashed4 ā•Ž
lineVerticalDashed5 ā•
lineVerticalDashed6 ā•µ
lineVerticalDashed7 ā•·
lineVerticalDashed8 ā•¹
lineVerticalDashed9 ā•»
lineVerticalDashed10 ā•½
lineVerticalDashed11 ā•æ
lineDownLeft ā”
lineDownLeftArc ā•®
lineDownBoldLeftBold ā”“
lineDownBoldLeft ā”’
lineDownLeftBold ā”‘
lineDownDoubleLeftDouble ā•—
lineDownDoubleLeft ā•–
lineDownLeftDouble ā••
lineDownRight ā”Œ
lineDownRightArc ā•­
lineDownBoldRightBold ā”
lineDownBoldRight ā”Ž
lineDownRightBold ā”
lineDownDoubleRightDouble ā•”
lineDownDoubleRight ā•“
lineDownRightDouble ā•’
lineUpLeft ā”˜
lineUpLeftArc ā•Æ
lineUpBoldLeftBold ā”›
lineUpBoldLeft ā”š
lineUpLeftBold ā”™
lineUpDoubleLeftDouble ā•
lineUpDoubleLeft ā•œ
lineUpLeftDouble ā•›
lineUpRight ā””
lineUpRightArc ā•°
lineUpBoldRightBold ā”—
lineUpBoldRight ā”–
lineUpRightBold ā”•
lineUpDoubleRightDouble ā•š
lineUpDoubleRight ā•™
lineUpRightDouble ā•˜
lineUpDownLeft ā”¤
lineUpBoldDownBoldLeftBold ā”«
lineUpBoldDownBoldLeft ā”Ø
lineUpDownLeftBold ā”„
lineUpBoldDownLeftBold ā”©
lineUpDownBoldLeftBold ā”Ŗ
lineUpDownBoldLeft ā”§
lineUpBoldDownLeft ā”¦
lineUpDoubleDownDoubleLeftDouble ā•£
lineUpDoubleDownDoubleLeft ā•¢
lineUpDownLeftDouble ā•”
lineUpDownRight ā”œ
lineUpBoldDownBoldRightBold ā”£
lineUpBoldDownBoldRight ā” 
lineUpDownRightBold ā”
lineUpBoldDownRightBold ā””
lineUpDownBoldRightBold ā”¢
lineUpDownBoldRight ā”Ÿ
lineUpBoldDownRight ā”ž
lineUpDoubleDownDoubleRightDouble ā• 
lineUpDoubleDownDoubleRight ā•Ÿ
lineUpDownRightDouble ā•ž
lineDownLeftRight ā”¬
lineDownBoldLeftBoldRightBold ā”³
lineDownLeftBoldRightBold ā”Æ
lineDownBoldLeftRight ā”°
lineDownBoldLeftBoldRight ā”±
lineDownBoldLeftRightBold ā”²
lineDownLeftRightBold ā”®
lineDownLeftBoldRight ā”­
lineDownDoubleLeftDoubleRightDouble ā•¦
lineDownDoubleLeftRight ā•„
lineDownLeftDoubleRightDouble ā•¤
lineUpLeftRight ā”“
lineUpBoldLeftBoldRightBold ā”»
lineUpLeftBoldRightBold ā”·
lineUpBoldLeftRight ā”ø
lineUpBoldLeftBoldRight ā”¹
lineUpBoldLeftRightBold ā”ŗ
lineUpLeftRightBold ā”¶
lineUpLeftBoldRight ā”µ
lineUpDoubleLeftDoubleRightDouble ā•©
lineUpDoubleLeftRight ā•Ø
lineUpLeftDoubleRightDouble ā•§
lineUpDownLeftRight ā”¼
lineUpBoldDownBoldLeftBoldRightBold ā•‹
lineUpDownBoldLeftBoldRightBold ā•ˆ
lineUpBoldDownLeftBoldRightBold ā•‡
lineUpBoldDownBoldLeftRightBold ā•Š
lineUpBoldDownBoldLeftBoldRight ā•‰
lineUpBoldDownLeftRight ā•€
lineUpDownBoldLeftRight ā•
lineUpDownLeftBoldRight ā”½
lineUpDownLeftRightBold ā”¾
lineUpBoldDownBoldLeftRight ā•‚
lineUpDownLeftBoldRightBold ā”æ
lineUpBoldDownLeftBoldRight ā•ƒ
lineUpBoldDownLeftRightBold ā•„
lineUpDownBoldLeftBoldRight ā•…
lineUpDownBoldLeftRightBold ā•†
lineUpDoubleDownDoubleLeftDoubleRightDouble ā•¬
lineUpDoubleDownDoubleLeftRight ā•«
lineUpDownLeftDoubleRightDouble ā•Ŗ
lineCross ā•³
lineBackslash ā•²
lineSlash ā•±

Other characters

If you cannot find the character you're looking for in the table above, please look at this full list of cross-platform terminal characters.

Unsupported terminals

The following terminals are not officially supported:

  • xterm
  • Linux Terminal (kernel)
  • cmder

They can display most but not all of the symbols listed above.

Related

NodeJS Resources

are all listed below.

Resources

listed to get explored on!!

Made with ā¤ļø

to provide different kinds of informations and resources.