finds.dev

sofish/han

a module for tanslating Chinese(汉字) into /\w+/ or pinyin

View on GitHub

★ 201JavaScriptMITupdated Apr 2018

// the take

Han translates Chinese characters to pinyin romanization or plain ASCII letters, with optional tone marks. It's a utility library for anyone building URLs, slugs, or search indexes from Chinese text. Last touched in 2018.

Handles mixed input cleanly — Chinese, Latin, and symbols in one string without choking. Returns multiple pronunciations per character (homographs), which is the correct behavior for polyphonic characters. Sync and async calling conventions coexist without awkwardness. Reasonable test coverage with a Makefile that actually runs them.

Dead project — no commits since 2018, Travis CI badge is broken, and the npm package may not be maintained against current Node versions. No support for Traditional Chinese, so it's Simplified-only without documentation saying so. The polyphonic character handling punts disambiguation entirely to the caller — there's no context-aware selection, so automated slug generation will silently pick wrong readings. No TypeScript types, which matters if you're using this in a modern TS project.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
201
Forks
34
Language
JavaScript
License
MIT
Last commit
21 Apr 2018

// nearby

If han isn't quite it.

All repos →