is-unicode-supported

Detect whether the terminal supports Unicode

MIT 7 个版本
安装
npm install is-unicode-supported
yarn add is-unicode-supported
pnpm add is-unicode-supported
bun add is-unicode-supported
README

is-unicode-supported

Detect whether the terminal supports Unicode

This can be useful to decide whether to use Unicode characters or fallback ASCII characters in command-line output.

Note that the check is quite naive. It just assumes all non-Windows terminals support Unicode and hard-codes which Windows terminals that do support Unicode. However, I have been using this logic in some popular packages for years without problems.

Install

npm install is-unicode-supported

Usage

import isUnicodeSupported from 'is-unicode-supported';

isUnicodeSupported();
//=> true

API

isUnicodeSupported()

Returns a boolean for whether the terminal supports Unicode.

版本列表
2.1.0 2024-09-09
2.0.0 2023-10-29
1.3.0 2022-09-08
1.2.0 2022-03-23
1.1.0 2021-07-03
1.0.0 2021-04-18
0.1.0 2021-03-17