figures
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -1,23 +0,2 @@ | ||
declare const figures: { | ||
/** | ||
Replace unicode symbols depending on the OS. | ||
@param string - String where the Unicode symbols will be replaced with fallback symbols depending on the OS. | ||
@returns The input with replaced fallback Unicode symbols on Windows. | ||
@example | ||
``` | ||
import figures = require('figures'); | ||
console.log(figures('✔︎ check')); | ||
// On real OSes: ✔︎ check | ||
// On Windows: √ check | ||
console.log(figures.tick); | ||
// On real OSes: ✔︎ | ||
// On Windows: √ | ||
``` | ||
*/ | ||
(string: string): string; | ||
declare const figureSet: { | ||
readonly tick: string; | ||
@@ -80,4 +59,39 @@ readonly cross: string; | ||
readonly sevenEighth: string; | ||
}; | ||
} | ||
type FigureSet = typeof figureSet | ||
declare const figures: { | ||
/** | ||
Replace Unicode symbols depending on the OS. | ||
@param string - String where the Unicode symbols will be replaced with fallback symbols depending on the OS. | ||
@returns The input with replaced fallback Unicode symbols on Windows. | ||
@example | ||
``` | ||
import 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: √ | ||
``` | ||
*/ | ||
(string: string): string; | ||
/** | ||
Symbols to use when not running on Windows. | ||
*/ | ||
readonly main: FigureSet; | ||
/** | ||
Symbols to use when running on Windows. | ||
*/ | ||
readonly windows: FigureSet; | ||
} & FigureSet; | ||
export = figures; |
@@ -127,3 +127,3 @@ 'use strict'; | ||
if (platform === 'linux') { | ||
// The main one doesn't look that good on Ubuntu | ||
// The main one doesn't look that good on Ubuntu. | ||
main.questionMarkPrefix = '?'; | ||
@@ -151,1 +151,3 @@ } | ||
module.exports = Object.assign(fn, figures); | ||
module.exports.main = main; | ||
module.exports.windows = windows; |
{ | ||
"name": "figures", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Unicode symbols with Windows CMD fallbacks", | ||
"license": "MIT", | ||
"repository": "sindresorhus/figures", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
@@ -40,3 +41,2 @@ "engines": { | ||
"ava": "^1.4.1", | ||
"import-fresh": "^3.0.0", | ||
"markdown-table": "^1.1.2", | ||
@@ -43,0 +43,0 @@ "tsd": "^0.7.2", |
144
readme.md
@@ -11,3 +11,2 @@ # figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures) | ||
## Install | ||
@@ -19,3 +18,2 @@ | ||
## Usage | ||
@@ -29,11 +27,16 @@ | ||
console.log(figures('✔︎ check')); | ||
// On real OSes: ✔︎ check | ||
// On Windows: √ check | ||
// On non-Windows OSes: ✔︎ check | ||
// On Windows: √ check | ||
console.log(figures.tick); | ||
// On real OSes: ✔︎ | ||
// On Windows: √ | ||
// On non-Windows OSes: ✔︎ | ||
// On Windows: √ | ||
console.log(figures.main.tick); | ||
// On all OSes: ✔︎ | ||
console.log(figures.windows.tick); | ||
// On all OSes: √ | ||
``` | ||
## API | ||
@@ -53,64 +56,72 @@ | ||
### figures.main | ||
Symbols to use when not running on Windows. | ||
### figures.windows | ||
Symbols to use when running on Windows. | ||
## Figures | ||
| Name | Real OSes | 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 | → | → | | ||
| radioOn | ◉ | (*) | | ||
| radioOff | ◯ | ( ) | | ||
| checkboxOn | ☒ | [×] | | ||
| checkboxOff | ☐ | [ ] | | ||
| checkboxCircleOn | ⓧ | (×) | | ||
| checkboxCircleOff | Ⓘ | ( ) | | ||
| questionMarkPrefix | ?⃝ | ? | | ||
| oneHalf | ½ | 1/2 | | ||
| oneThird | ⅓ | 1/3 | | ||
| oneQuarter | ¼ | 1/4 | | ||
| oneFifth | ⅕ | 1/5 | | ||
| oneSixth | ⅙ | 1/6 | | ||
| oneSeventh | ⅐ | 1/7 | | ||
| oneEighth | ⅛ | 1/8 | | ||
| oneNinth | ⅑ | 1/9 | | ||
| oneTenth | ⅒ | 1/10 | | ||
| twoThirds | ⅔ | 2/3 | | ||
| twoFifths | ⅖ | 2/5 | | ||
| threeQuarters | ¾ | 3/4 | | ||
| threeFifths | ⅗ | 3/5 | | ||
| threeEighths | ⅜ | 3/8 | | ||
| fourFifths | ⅘ | 4/5 | | ||
| fiveSixths | ⅚ | 5/6 | | ||
| fiveEighths | ⅝ | 5/8 | | ||
| sevenEighths | ⅞ | 7/8 | | ||
| 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 | → | → | | ||
| radioOn | ◉ | (*) | | ||
| radioOff | ◯ | ( ) | | ||
| checkboxOn | ☒ | [×] | | ||
| checkboxOff | ☐ | [ ] | | ||
| checkboxCircleOn | ⓧ | (×) | | ||
| checkboxCircleOff | Ⓘ | ( ) | | ||
| questionMarkPrefix | ?⃝ | ? | | ||
| oneHalf | ½ | 1/2 | | ||
| oneThird | ⅓ | 1/3 | | ||
| oneQuarter | ¼ | 1/4 | | ||
| oneFifth | ⅕ | 1/5 | | ||
| oneSixth | ⅙ | 1/6 | | ||
| oneSeventh | ⅐ | 1/7 | | ||
| oneEighth | ⅛ | 1/8 | | ||
| oneNinth | ⅑ | 1/9 | | ||
| oneTenth | ⅒ | 1/10 | | ||
| twoThirds | ⅔ | 2/3 | | ||
| twoFifths | ⅖ | 2/5 | | ||
| threeQuarters | ¾ | 3/4 | | ||
| threeFifths | ⅗ | 3/5 | | ||
| threeEighths | ⅜ | 3/8 | | ||
| fourFifths | ⅘ | 4/5 | | ||
| fiveSixths | ⅚ | 5/6 | | ||
| fiveEighths | ⅝ | 5/8 | | ||
| sevenEighths | ⅞ | 7/8 | | ||
@@ -122,3 +133,2 @@ | ||
--- | ||
@@ -125,0 +135,0 @@ |
Sorry, the diff of this file is not supported yet
12075
4
228
140