Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 90,370,517 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.