finds.dev← search

// the find

sofish/han

★ 201 · JavaScript · MIT · updated Apr 2018

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

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →