🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

is-unicode-supported

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-unicode-supported

Detect whether the terminal supports Unicode

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
43M
-12.32%
Maintainers
1
Weekly downloads
 
Created
Source

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.

  • is-interactive - Check if stdout or stderr is interactive
  • supports-color - Detect whether a terminal supports color
  • figures - Unicode symbols with Windows fallbacks
  • log-symbols - Colored symbols for various log levels

Keywords

terminal

FAQs

Package last updated on 09 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts