Comparing version
@@ -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 [](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
6.67%4
-20%228
6.05%140
7.69%