Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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 97,074,634 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.