Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
is-fullwidth-code-point
Advanced tools
Check if the character represented by a given Unicode code point is fullwidth
The is-fullwidth-code-point npm package is used to determine if a given Unicode code point will be displayed as full-width in a terminal. Full-width characters take up two spaces in a monospace grid, as opposed to half-width characters that take up one space. This is particularly useful when dealing with CJK (Chinese, Japanese, and Korean) characters, emojis, or other symbols that may not conform to the standard width of ASCII characters.
Check if a code point is full-width
This feature allows you to check if a single Unicode code point is considered full-width. The function returns a boolean value.
const isFullwidthCodePoint = require('is-fullwidth-code-point');
console.log(isFullwidthCodePoint('あ'.codePointAt(0))); // true
console.log(isFullwidthCodePoint('A'.codePointAt(0))); // false
This package calculates and returns the width of a string by considering full-width characters and ANSI escape codes. It uses is-fullwidth-code-point internally to determine the width of individual characters.
Based on the wcwidth implementation in C, this package provides a JavaScript function to get the printable width of a string on the terminal. It is similar to is-fullwidth-code-point but works at the string level rather than individual code points.
This package categorizes Unicode characters according to their East Asian Width properties, which can be used to determine if characters are full-width, half-width, wide, narrow, ambiguous, or neutral. It provides more detailed information compared to is-fullwidth-code-point.
Check if the character represented by a given Unicode code point is fullwidth
npm install is-fullwidth-code-point
import isFullwidthCodePoint from 'is-fullwidth-code-point';
isFullwidthCodePoint('谢'.codePointAt(0));
//=> true
isFullwidthCodePoint('a'.codePointAt(0));
//=> false
Type: number
The code point of a character.
FAQs
Check if the character represented by a given Unicode code point is fullwidth
The npm package is-fullwidth-code-point receives a total of 77,897,783 weekly downloads. As such, is-fullwidth-code-point popularity was classified as popular.
We found that is-fullwidth-code-point demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.