๐Ÿš€ Big News:Socket Has Acquired Secure Annex.Learn More โ†’
Socket
Book a DemoSign in
Socket

figures

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

figures

Unicode symbols with fallbacks for older terminals

latest
Source
npmnpm
Version
6.1.0
Version published
Weekly downloads
50M
-18.17%
Maintainers
1
Weekly downloads
ย 
Created
Source

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.

NameMainFallback
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.

Keywords

unicode

FAQs

Package last updated on 04 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts