# sxei/pinyinjs

一个实现汉字与拼音互转的小巧web工具库，演示地址：

Repository: https://github.com/sxei/pinyinjs
Canonical: https://ross.abutalabs.com/products/pinyinjs
Homepage: http://demo.haoji.me/pinyinjs/
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2022-03-22T06:13:19+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3627, "days_push": 1625, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2760, forks 790 (observed 2026-08-28T04:07:18.424975+00:00)

## What it is
A small JavaScript library for converting between Chinese characters and pinyin, supporting output with tones, without tones, or as first letters, plus basic polyphone handling via optional phrase dictionaries. It also includes a simple JS-based pinyin input method (IME) demo.

## Use cases
- convert chinese characters to pinyin in the browser
- get pinyin first letters of chinese text
- handle chinese polyphonic characters
- build a simple pinyin input method in javascript
- sort or index chinese text by pinyin
- annotate chinese text with tone-marked pinyin

## When to choose
- you need a tiny dictionary footprint for web pages (25-122kb)
- you only need basic hanzi-to-pinyin conversion or first letters
- you want a dependency-free pure JavaScript solution

## When to avoid
- you need highly accurate polyphone disambiguation in production
- you need server-side Chinese word segmentation quality
- you need pinyin-to-hanzi conversion at scale

## Facets
- artifact type: library
- maturity: maintenance
- function: nlp, parser, sdk
- domain: web-development
- platform: browser
- tags: pinyin, chinese-characters, ime, polyphone, dictionary-files, unicode, natural-language-processing, localization, nodejs, javascript

## Member repositories
- sxei/pinyinjs (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:18.424975+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:18:46.232492+00:00, confidence not recorded.
  - readme: https://github.com/sxei/pinyinjs (fetched 2026-08-28T04:07:18.424975+00:00, sha 5f1fbc77f880)
  - homepage: http://demo.haoji.me/pinyinjs/ (fetched 2026-08-29T09:56:46.423904+00:00, sha 99a0474a80b2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
