npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

figures

v6.1.0

Published

Unicode symbols with fallbacks for older terminals

Downloads

145,215,840

Readme

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