{"id":704,"url":"https://github.com/sindresorhus/figures","last_synced_at":"2025-05-14T09:09:01.894Z","repository":{"id":18477733,"uuid":"21672939","full_name":"sindresorhus/figures","owner":"sindresorhus","description":"Unicode symbols with fallbacks for older terminals","archived":false,"fork":false,"pushed_at":"2024-10-28T05:10:30.000Z","size":101,"stargazers_count":601,"open_issues_count":0,"forks_count":23,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-03T00:26:40.956Z","etag":null,"topics":["command-line","command-line-utility","node-module","npm-package","terminal","unicode","unicode-symbols"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2014-07-10T00:02:21.000Z","updated_at":"2025-04-20T06:24:06.000Z","dependencies_parsed_at":"2024-01-13T10:13:27.474Z","dependency_job_id":"597c92dd-633f-4ae4-b243-692778028fe8","html_url":"https://github.com/sindresorhus/figures","commit_stats":{"total_commits":127,"total_committers":12,"mean_commits":"10.583333333333334","dds":0.5196850393700787,"last_synced_commit":"3da3d1713e9a09dbfcfc99eac86af8f4377597b6"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ffigures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ffigures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ffigures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Ffigures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/figures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253214593,"owners_count":21872503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","command-line-utility","node-module","npm-package","terminal","unicode","unicode-symbols"],"created_at":"2024-01-05T20:15:29.244Z","updated_at":"2025-05-14T09:09:01.871Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# figures\n\n\u003e Unicode symbols with fallbacks for older terminals\n\n[![](screenshot.png)](index.js)\n\n[*and more...*](index.js)\n\nTerminals such as Windows Console Host (and CMD) only support a [limited character set](http://en.wikipedia.org/wiki/Code_page_437).\n\n## Install\n\n```sh\nnpm install figures\n```\n\n## Usage\n\n```js\nimport figures, {mainSymbols, fallbackSymbols, replaceSymbols} from 'figures';\n\nconsole.log(figures.tick);\n// On terminals with Unicode symbols:  ✔\n// On other terminals:                 √\n\nconsole.log(mainSymbols.tick);\n// On all terminals:  ✔\n\nconsole.log(fallbackSymbols.tick);\n// On all terminals:  √\n\nconsole.log(replaceSymbols('✔ check'));\n// On terminals with Unicode symbols:  ✔ check\n// On other terminals:                 √ check\n```\n\n## API\n\n### figures (default export)\n\nType: `object`\n\nSymbols to use on any terminal.\n\n### mainSymbols\n\nSymbols to use when the terminal supports Unicode symbols.\n\n### fallbackSymbols\n\nSymbols to use when the terminal does not support Unicode symbols.\n\n### replaceSymbols(string, options?)\n\nReturns the input with replaced fallback symbols if the terminal has poor Unicode support.\n\nAll the below [figures](#figures) are attached to the default export as shown in the example above.\n\n#### string\n\nType: `string`\n\nString where the Unicode symbols will be replaced with fallback symbols depending on the terminal.\n\n#### options\n\nType: `object`\n\n##### useFallback\n\nType: `boolean`\\\nDefault: `true` if the terminal has poor Unicode support\n\nWhether to replace symbols with fallbacks.\n\nThis can be set to `true` to always use fallback symbols, whether the terminal has poor Unicode support or not.\n\n```js\nimport {replaceSymbols} from 'figures';\n\nconsole.log(replaceSymbols('✔ check', {useFallback: true}));\n// On terminals with Unicode symbols:  √ check\n// On other terminals:                 √ check\n```\n\n## Figures\n\n`Fallback` characters are only shown when they differ from the `Main` ones.\n\n| Name                                        | Main | Fallback |\n| ------------------------------------------- | :--: | :------: |\n| tick                                        | `✔`  |   `√`   |\n| info                                        | `ℹ`  |   `i`   |\n| warning                                     | `⚠`  |   `‼`   |\n| cross                                       | `✘`  |   `×`   |\n| square                                      | `█`  |         |\n| squareSmall                                 | `◻`  |   `□`   |\n| squareSmallFilled                           | `◼`  |   `■`   |\n| squareDarkShade                             | `▓`  |         |\n| squareMediumShade                           | `▒`  |         |\n| squareLightShade                            | `░`  |         |\n| squareTop                                   | `▀`  |         |\n| squareBottom                                | `▄`  |         |\n| squareLeft                                  | `▌`  |         |\n| squareRight                                 | `▐`  |         |\n| squareCenter                                | `■`  |         |\n| circle                                      | `◯`  |  `( )`  |\n| circleFilled                                | `◉`  |  `(*)`  |\n| circleDotted                                | `◌`  |  `( )`  |\n| circleDouble                                | `◎`  |  `( )`  |\n| circleCircle                                | `ⓞ`  |  `(○)`  |\n| circleCross                                 | `ⓧ`  |  `(×)`  |\n| circlePipe                                  | `Ⓘ`  |  `(│)`  |\n| circleQuestionMark                          | `?⃝ ` |  `(?)`  |\n| radioOn                                     | `◉`  |  `(*)`  |\n| radioOff                                    | `◯`  |  `( )`  |\n| checkboxOn                                  | `☒`  |  `[×]`  |\n| checkboxOff                                 | `☐`  |  `[ ]`  |\n| checkboxCircleOn                            | `ⓧ`  |  `(×)`  |\n| checkboxCircleOff                           | `Ⓘ`  |  `( )`  |\n| questionMarkPrefix                          | `?⃝ ` |   `？`  |\n| bullet                                      | `●`  |         |\n| dot                                         | `․`  |         |\n| ellipsis                                    | `…`  |         |\n| pointer                                     | `❯`  |   `\u003e`   |\n| pointerSmall                                | `›`  |   `›`   |\n| triangleUp                                  | `▲`  |         |\n| triangleUpSmall                             | `▴`  |         |\n| triangleUpOutline                           | `△`  |   `∆`   |\n| triangleDown                                | `▼`  |         |\n| triangleDownSmall                           | `▾`  |         |\n| triangleLeft                                | `◀`  |   `◄`   |\n| triangleLeftSmall                           | `◂`  |         |\n| triangleRight                               | `▶`  |   `►`   |\n| triangleRightSmall                          | `▸`  |         |\n| lozenge                                     | `◆`  |   `♦`   |\n| lozengeOutline                              | `◇`  |   `◊`   |\n| home                                        | `⌂`  |         |\n| hamburger                                   | `☰`  |   `≡`   |\n| smiley                                      | `㋡` |   `☺`   |\n| mustache                                    | `෴`  |  `┌─┐`  |\n| heart                                       | `♥`  |         |\n| star                                        | `★`  |   `✶`   |\n| play                                        | `▶`  |   `►`   |\n| musicNote                                   | `♪`  |         |\n| musicNoteBeamed                             | `♫`  |         |\n| nodejs                                      | `⬢`  |   `♦`   |\n| arrowUp                                     | `↑`  |         |\n| arrowDown                                   | `↓`  |         |\n| arrowLeft                                   | `←`  |         |\n| arrowRight                                  | `→`  |         |\n| arrowLeftRight                              | `↔`  |         |\n| arrowUpDown                                 | `↕`  |         |\n| almostEqual                                 | `≈`  |         |\n| notEqual                                    | `≠`  |         |\n| lessOrEqual                                 | `≤`  |         |\n| greaterOrEqual                              | `≥`  |         |\n| identical                                   | `≡`  |         |\n| infinity                                    | `∞`  |         |\n| subscriptZero                               | `₀`  |         |\n| subscriptOne                                | `₁`  |         |\n| subscriptTwo                                | `₂`  |         |\n| subscriptThree                              | `₃`  |         |\n| subscriptFour                               | `₄`  |         |\n| subscriptFive                               | `₅`  |         |\n| subscriptSix                                | `₆`  |         |\n| subscriptSeven                              | `₇`  |         |\n| subscriptEight                              | `₈`  |         |\n| subscriptNine                               | `₉`  |         |\n| oneHalf                                     | `½`  |         |\n| oneThird                                    | `⅓`  |         |\n| oneQuarter                                  | `¼`  |         |\n| oneFifth                                    | `⅕`  |         |\n| oneSixth                                    | `⅙`  |         |\n| oneSeventh                                  | `⅐`  |  `1/7`  |\n| oneEighth                                   | `⅛`  |         |\n| oneNinth                                    | `⅑`  |  `1/9`  |\n| oneTenth                                    | `⅒`  |  `1/10` |\n| twoThirds                                   | `⅔`  |         |\n| twoFifths                                   | `⅖`  |         |\n| threeQuarters                               | `¾`  |         |\n| threeFifths                                 | `⅗`  |         |\n| threeEighths                                | `⅜`  |         |\n| fourFifths                                  | `⅘`  |         |\n| fiveSixths                                  | `⅚`  |         |\n| fiveEighths                                 | `⅝`  |         |\n| sevenEighths                                | `⅞`  |         |\n| line                                        | `─`  |         |\n| lineBold                                    | `━`  |         |\n| lineDouble                                  | `═`  |         |\n| lineDashed0                                 | `┄`  |         |\n| lineDashed1                                 | `┅`  |         |\n| lineDashed2                                 | `┈`  |         |\n| lineDashed3                                 | `┉`  |         |\n| lineDashed4                                 | `╌`  |         |\n| lineDashed5                                 | `╍`  |         |\n| lineDashed6                                 | `╴`  |         |\n| lineDashed7                                 | `╶`  |         |\n| lineDashed8                                 | `╸`  |         |\n| lineDashed9                                 | `╺`  |         |\n| lineDashed10                                | `╼`  |         |\n| lineDashed11                                | `╾`  |         |\n| lineDashed12                                | `−`  |         |\n| lineDashed13                                | `–`  |         |\n| lineDashed14                                | `‐`  |         |\n| lineDashed15                                | `⁃`  |         |\n| lineVertical                                | `│`  |         |\n| lineVerticalBold                            | `┃`  |         |\n| lineVerticalDouble                          | `║`  |         |\n| lineVerticalDashed0                         | `┆`  |         |\n| lineVerticalDashed1                         | `┇`  |         |\n| lineVerticalDashed2                         | `┊`  |         |\n| lineVerticalDashed3                         | `┋`  |         |\n| lineVerticalDashed4                         | `╎`  |         |\n| lineVerticalDashed5                         | `╏`  |         |\n| lineVerticalDashed6                         | `╵`  |         |\n| lineVerticalDashed7                         | `╷`  |         |\n| lineVerticalDashed8                         | `╹`  |         |\n| lineVerticalDashed9                         | `╻`  |         |\n| lineVerticalDashed10                        | `╽`  |         |\n| lineVerticalDashed11                        | `╿`  |         |\n| lineDownLeft                                | `┐`  |         |\n| lineDownLeftArc                             | `╮`  |         |\n| lineDownBoldLeftBold                        | `┓`  |         |\n| lineDownBoldLeft                            | `┒`  |         |\n| lineDownLeftBold                            | `┑`  |         |\n| lineDownDoubleLeftDouble                    | `╗`  |         |\n| lineDownDoubleLeft                          | `╖`  |         |\n| lineDownLeftDouble                          | `╕`  |         |\n| lineDownRight                               | `┌`  |         |\n| lineDownRightArc                            | `╭`  |         |\n| lineDownBoldRightBold                       | `┏`  |         |\n| lineDownBoldRight                           | `┎`  |         |\n| lineDownRightBold                           | `┍`  |         |\n| lineDownDoubleRightDouble                   | `╔`  |         |\n| lineDownDoubleRight                         | `╓`  |         |\n| lineDownRightDouble                         | `╒`  |         |\n| lineUpLeft                                  | `┘`  |         |\n| lineUpLeftArc                               | `╯`  |         |\n| lineUpBoldLeftBold                          | `┛`  |         |\n| lineUpBoldLeft                              | `┚`  |         |\n| lineUpLeftBold                              | `┙`  |         |\n| lineUpDoubleLeftDouble                      | `╝`  |         |\n| lineUpDoubleLeft                            | `╜`  |         |\n| lineUpLeftDouble                            | `╛`  |         |\n| lineUpRight                                 | `└`  |         |\n| lineUpRightArc                              | `╰`  |         |\n| lineUpBoldRightBold                         | `┗`  |         |\n| lineUpBoldRight                             | `┖`  |         |\n| lineUpRightBold                             | `┕`  |         |\n| lineUpDoubleRightDouble                     | `╚`  |         |\n| lineUpDoubleRight                           | `╙`  |         |\n| lineUpRightDouble                           | `╘`  |         |\n| lineUpDownLeft                              | `┤`  |         |\n| lineUpBoldDownBoldLeftBold                  | `┫`  |         |\n| lineUpBoldDownBoldLeft                      | `┨`  |         |\n| lineUpDownLeftBold                          | `┥`  |         |\n| lineUpBoldDownLeftBold                      | `┩`  |         |\n| lineUpDownBoldLeftBold                      | `┪`  |         |\n| lineUpDownBoldLeft                          | `┧`  |         |\n| lineUpBoldDownLeft                          | `┦`  |         |\n| lineUpDoubleDownDoubleLeftDouble            | `╣`  |         |\n| lineUpDoubleDownDoubleLeft                  | `╢`  |         |\n| lineUpDownLeftDouble                        | `╡`  |         |\n| lineUpDownRight                             | `├`  |         |\n| lineUpBoldDownBoldRightBold                 | `┣`  |         |\n| lineUpBoldDownBoldRight                     | `┠`  |         |\n| lineUpDownRightBold                         | `┝`  |         |\n| lineUpBoldDownRightBold                     | `┡`  |         |\n| lineUpDownBoldRightBold                     | `┢`  |         |\n| lineUpDownBoldRight                         | `┟`  |         |\n| lineUpBoldDownRight                         | `┞`  |         |\n| lineUpDoubleDownDoubleRightDouble           | `╠`  |         |\n| lineUpDoubleDownDoubleRight                 | `╟`  |         |\n| lineUpDownRightDouble                       | `╞`  |         |\n| lineDownLeftRight                           | `┬`  |         |\n| lineDownBoldLeftBoldRightBold               | `┳`  |         |\n| lineDownLeftBoldRightBold                   | `┯`  |         |\n| lineDownBoldLeftRight                       | `┰`  |         |\n| lineDownBoldLeftBoldRight                   | `┱`  |         |\n| lineDownBoldLeftRightBold                   | `┲`  |         |\n| lineDownLeftRightBold                       | `┮`  |         |\n| lineDownLeftBoldRight                       | `┭`  |         |\n| lineDownDoubleLeftDoubleRightDouble         | `╦`  |         |\n| lineDownDoubleLeftRight                     | `╥`  |         |\n| lineDownLeftDoubleRightDouble               | `╤`  |         |\n| lineUpLeftRight                             | `┴`  |         |\n| lineUpBoldLeftBoldRightBold                 | `┻`  |         |\n| lineUpLeftBoldRightBold                     | `┷`  |         |\n| lineUpBoldLeftRight                         | `┸`  |         |\n| lineUpBoldLeftBoldRight                     | `┹`  |         |\n| lineUpBoldLeftRightBold                     | `┺`  |         |\n| lineUpLeftRightBold                         | `┶`  |         |\n| lineUpLeftBoldRight                         | `┵`  |         |\n| lineUpDoubleLeftDoubleRightDouble           | `╩`  |         |\n| lineUpDoubleLeftRight                       | `╨`  |         |\n| lineUpLeftDoubleRightDouble                 | `╧`  |         |\n| lineUpDownLeftRight                         | `┼`  |         |\n| lineUpBoldDownBoldLeftBoldRightBold         | `╋`  |         |\n| lineUpDownBoldLeftBoldRightBold             | `╈`  |         |\n| lineUpBoldDownLeftBoldRightBold             | `╇`  |         |\n| lineUpBoldDownBoldLeftRightBold             | `╊`  |         |\n| lineUpBoldDownBoldLeftBoldRight             | `╉`  |         |\n| lineUpBoldDownLeftRight                     | `╀`  |         |\n| lineUpDownBoldLeftRight                     | `╁`  |         |\n| lineUpDownLeftBoldRight                     | `┽`  |         |\n| lineUpDownLeftRightBold                     | `┾`  |         |\n| lineUpBoldDownBoldLeftRight                 | `╂`  |         |\n| lineUpDownLeftBoldRightBold                 | `┿`  |         |\n| lineUpBoldDownLeftBoldRight                 | `╃`  |         |\n| lineUpBoldDownLeftRightBold                 | `╄`  |         |\n| lineUpDownBoldLeftBoldRight                 | `╅`  |         |\n| lineUpDownBoldLeftRightBold                 | `╆`  |         |\n| lineUpDoubleDownDoubleLeftDoubleRightDouble | `╬`  |         |\n| lineUpDoubleDownDoubleLeftRight             | `╫`  |         |\n| lineUpDownLeftDoubleRightDouble             | `╪`  |         |\n| lineCross                                   | `╳`  |         |\n| lineBackslash                               | `╲`  |         |\n| lineSlash                                   | `╱`  |         |\n\n## Other characters\n\nIf you cannot find the character you're looking for in the table above, please look at this full list of [cross-platform terminal characters](https://github.com/ehmicky/cross-platform-terminal-characters).\n\n## Unsupported terminals\n\nThe following terminals are not officially supported:\n\n- xterm\n- Linux Terminal (kernel)\n- cmder\n\nThey can display most but not all of the symbols listed above.\n\n## Related\n\n- [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["命令行","目录","Packages","JavaScript","Repository","包","Uncategorized","terminal","Libraries","打印","Command-line utilities"],"sub_categories":["redux 扩展","命令行工具","Command-line utilities","Command-line Utilities","Uncategorized","macros","Shell","命令行实用工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Ffigures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Ffigures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Ffigures/lists"}