aeeble

account_circle登入

pangu.js - Opinionated Paranoid Text Spacing in JavaScript

2025-09-04

For developers and users who value readability in Chinese text, pangu.js is a JavaScript library and Google Chrome extension that automatically inserts spaces between Chinese characters and half-width English letters, numbers, or symbols. This enhances the overall readability of web pages.

Key Features

  • Automatically adds spaces between Chinese and English text.
  • Supports both manual and automatic spacing options.
  • Includes blacklist and whitelist functionality for specific websites.

Usage

Developers can integrate pangu.js into their projects using npm:

npm install pangu --save-exact

For browser usage, include the UMD script:

<script src="pangu/dist/browser/pangu.umd.js"></script>

And then use it in your JavaScript code:

const text = pangu.spacingText('當你凝視著bug,bug也凝視著你');

Benefits

The pangu.js library and extension aim to improve the readability of Chinese text on the web by ensuring proper spacing between Chinese and English characters. This is particularly useful for users who prefer a more organized and visually appealing reading experience.

圖片
評價
相關列表
評論