tis-cli前端项目快速搭建命令行工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
4.6 KiB

4 years ago
  1. # figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures)
  2. > Unicode symbols with Windows CMD fallbacks
  3. [![](screenshot.png)](index.js)
  4. [*and more...*](index.js)
  5. Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437).
  6. ## Install
  7. ```
  8. $ npm install figures
  9. ```
  10. ## Usage
  11. See the [source](index.js) for supported symbols.
  12. ```js
  13. const figures = require('figures');
  14. console.log(figures('✔︎ check'));
  15. // On non-Windows OSes: ✔︎ check
  16. // On Windows: √ check
  17. console.log(figures.tick);
  18. // On non-Windows OSes: ✔︎
  19. // On Windows: √
  20. console.log(figures.main.tick);
  21. // On all OSes: ✔︎
  22. console.log(figures.windows.tick);
  23. // On all OSes: √
  24. ```
  25. ## API
  26. ### figures(string)
  27. Returns the input with replaced fallback Unicode symbols on Windows.
  28. All the below [figures](#figures) are attached to the main export as shown in the example above.
  29. #### string
  30. Type: `string`
  31. String where the Unicode symbols will be replaced with fallback symbols depending on the OS.
  32. ### figures.main
  33. Symbols to use when not running on Windows.
  34. ### figures.windows
  35. Symbols to use when running on Windows.
  36. ## Figures
  37. | Name | Non-Windows | Windows |
  38. | ------------------ | :---------: | :-----: |
  39. | tick | ✔ | √ |
  40. | cross | ✖ | × |
  41. | star | ★ | * |
  42. | square | ▇ | █ |
  43. | squareSmall | ◻ | [ ] |
  44. | squareSmallFilled | ◼ | [█] |
  45. | play | ▶ | ► |
  46. | circle | ◯ | ( ) |
  47. | circleFilled | ◉ | (*) |
  48. | circleDotted | ◌ | ( ) |
  49. | circleDouble | ◎ | ( ) |
  50. | circleCircle | ⓞ | (○) |
  51. | circleCross | ⓧ | (×) |
  52. | circlePipe | Ⓘ | (│) |
  53. | circleQuestionMark | ?⃝ | (?) |
  54. | bullet | ● | * |
  55. | dot | ․ | . |
  56. | line | ─ | ─ |
  57. | ellipsis | … | ... |
  58. | pointer | ❯ | > |
  59. | pointerSmall | › | » |
  60. | info | ℹ | i |
  61. | warning | ⚠ | ‼ |
  62. | hamburger | ☰ | ≡ |
  63. | smiley | ㋡ | ☺ |
  64. | mustache | ෴ | ┌─┐ |
  65. | heart | ♥ | ♥ |
  66. | nodejs | ⬢ | ♦ |
  67. | arrowUp | ↑ | ↑ |
  68. | arrowDown | ↓ | ↓ |
  69. | arrowLeft | ← | ← |
  70. | arrowRight | → | → |
  71. | radioOn | ◉ | (*) |
  72. | radioOff | ◯ | ( ) |
  73. | checkboxOn | ☒ | [×] |
  74. | checkboxOff | ☐ | [ ] |
  75. | checkboxCircleOn | ⓧ | (×) |
  76. | checkboxCircleOff | Ⓘ | ( ) |
  77. | questionMarkPrefix | ?⃝ | ? |
  78. | oneHalf | ½ | 1/2 |
  79. | oneThird | ⅓ | 1/3 |
  80. | oneQuarter | ¼ | 1/4 |
  81. | oneFifth | ⅕ | 1/5 |
  82. | oneSixth | ⅙ | 1/6 |
  83. | oneSeventh | ⅐ | 1/7 |
  84. | oneEighth | ⅛ | 1/8 |
  85. | oneNinth | ⅑ | 1/9 |
  86. | oneTenth | ⅒ | 1/10 |
  87. | twoThirds | ⅔ | 2/3 |
  88. | twoFifths | ⅖ | 2/5 |
  89. | threeQuarters | ¾ | 3/4 |
  90. | threeFifths | ⅗ | 3/5 |
  91. | threeEighths | ⅜ | 3/8 |
  92. | fourFifths | ⅘ | 4/5 |
  93. | fiveSixths | ⅚ | 5/6 |
  94. | fiveEighths | ⅝ | 5/8 |
  95. | sevenEighths | ⅞ | 7/8 |
  96. ## Related
  97. - [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels
  98. ---
  99. <div align="center">
  100. <b>
  101. <a href="https://tidelift.com/subscription/pkg/npm-figures?utm_source=npm-figures&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
  102. </b>
  103. <br>
  104. <sub>
  105. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  106. </sub>
  107. </div>