Socket
Socket
Sign inDemoInstall

is-unicode-supported

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-unicode-supported

Detect whether the terminal supports Unicode


Version published
Weekly downloads
27M
increased by2.42%
Maintainers
1
Install size
3.81 kB
Created
Weekly downloads
 

Package description

What is is-unicode-supported?

The is-unicode-supported npm package is a simple utility that allows you to check if the environment where your Node.js application is running supports Unicode. This can be particularly useful when you want to ensure that Unicode characters are displayed correctly in the terminal or console.

What are is-unicode-supported's main functionalities?

Check Unicode support

This feature allows you to check if Unicode is supported in the current environment. The function returns a boolean value indicating the support status.

const isUnicodeSupported = require('is-unicode-supported');

if (isUnicodeSupported()) {
  console.log('Unicode is supported!');
} else {
  console.log('Unicode is not supported.');
}

Other packages similar to is-unicode-supported

Readme

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

FAQs

Last updated on 29 Oct 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc