Skip to content

Latest commit

 

History

History
151 lines (119 loc) · 5.14 KB

readme.md

File metadata and controls

151 lines (119 loc) · 5.14 KB

figures

Unicode symbols with Windows CMD fallbacks

and more...

Windows CMD only supports a limited character set.

Install

$ npm install figures

Usage

See the source for supported symbols.

const figures = require('figures');

console.log(figures('✔︎ check'));
// On non-Windows OSes:  ✔︎ check
// On Windows:           √ check

console.log(figures.tick);
// On non-Windows OSes:  ✔︎
// On Windows:           √

console.log(figures.main.tick);
// On all OSes:  ✔︎

console.log(figures.windows.tick);
// On all OSes:  √

API

figures(string)

Returns the input with replaced fallback Unicode symbols on Windows.

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

string

Type: string

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

figures.main

Symbols to use when not running on Windows.

figures.windows

Symbols to use when running on Windows.

Figures

Name Non-Windows Windows
tick
cross ×
star
square
squareSmall
squareSmallFilled
play
circle ( )
circleFilled (*)
circleDotted ( )
circleDouble ( )
circleCircle (○)
circleCross (×)
circlePipe (│)
circleQuestionMark ?⃝ (?)
bullet
dot
line
ellipsis
pointer >
pointerSmall
info i
warning
hamburger
smiley
mustache ┌─┐
heart
nodejs
arrowUp
arrowDown
arrowLeft
arrowRight
arrowLeftRight
arrowUpDown
radioOn (*)
radioOff ( )
checkboxOn [×]
checkboxOff [ ]
checkboxCircleOn (×)
checkboxCircleOff ( )
questionMarkPrefix ?⃝
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

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.