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.
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也凝視著你');
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.