Wcwidth-O1: TypeScript/JavaScript Implementation of Unicode Character Width Calculation
By
dawson0
The bagel they save for the regulars. Don't skim, savour.
Summary
Wcwidth-O1 is a TypeScript/JavaScript implementation of Markus Kuhn's wcwidth and wcswidth functions, which determine how many terminal columns Unicode characters occupy. The library faithfully clones the original POSIX-standard implementation while optimizing performance to O(1) complexity. It handles character width calculations for both standard and CJK (Chinese, Japanese, Korean) characters, where East Asian ideographs typically occupy two columns instead of one.
Key quotes
· 4 pulledA TypeScript/JavaScript port of Markus Kuhn's wcwidth and wcswidth implementations, optimized to O(1)
These functions are defined in IEEE Std 1003.1 (POSIX)
In fixed-width terminals, most Latin characters take up one column, while East Asian (CJK) ideographs usually take up two
The challenge is deciding how many 'cells' each Unicode character should occupy so that text aligns
You might also wanna read
Erlang Ecosystem Foundation Launches Central Company Registry
The Erlang Ecosystem Foundation has launched a new canonical company registry at registry.erlef.org. The registry aims to serve members, spo
aislop: Open-source CLI tool detects low-quality code patterns left by AI coding agents
aislop is an open-source CLI tool (MIT-licensed) that detects low-quality patterns left behind by AI coding agents like Claude Code, Cursor,
OpenStatus: Open-Source Status Page and Uptime Monitoring Platform
OpenStatus is an open-source status page and uptime monitoring platform designed for developers to showcase their service reliability. It pr
Jujutsu (jj): A Git-Compatible Version Control System Focused on Simplicity and Power
Jujutsu (jj) is a Git-compatible version control system designed to be both simple and powerful. It abstracts the user interface and version
xlide_vscode: Edit Excel VBA Code Directly in VS Code with Full Read/Write and AI Integration
This article presents xlide_vscode, an open-source VS Code extension that enables direct editing of Excel VBA code within Visual Studio Code
tldx: Open-source CLI tool for bulk domain availability checking via RDAP
tldx is an open-source, blazing-fast CLI tool written in Go that bulk-checks domain availability via RDAP. It allows users to generate and c
