pangu.js is a lightweight JavaScript library that automatically inserts proper spacing between Chinese, Japanese, or Korean (CJK) characters and Latin letters, numbers, or symbols. The goal is typographic polish: mixed-script text often becomes cramped or ambiguous without the correct spacing rules, and pangu.js fixes that reliably. It uses rule-based detection to walk text and add spaces where needed without altering the characters themselves. The library runs in browsers or Node.js, and can process raw strings, DOM nodes, or entire documents. Because it’s idempotent, applying it repeatedly won’t keep adding extra gaps, which makes it safe in pipelines. It’s a pragmatic tool for blogs, documentation, and apps that present multilingual content.

Features

  • Automatic insertion of spaces between CJK and Latin or numeric text
  • Works on strings, DOM nodes, or full documents in the browser
  • Node.js support for server-side processing and build pipelines
  • Rule-based, idempotent transformations to prevent over-spacing
  • Simple API surface for quick integration into sites and apps
  • Improves readability and professionalism of mixed-script layouts

Project Samples

Project Activity

See All Activity >

Categories

Design

License

MIT License

Follow pangu.js

pangu.js Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of pangu.js!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

TypeScript

Related Categories

TypeScript Design Software

Registered

2025-10-15