npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@seyoungsong/hanjadict

v0.4.5

Published

A lightweight JavaScript library for looking up Korean Hanja characters with their 훈음 (Hun-eum) meanings and pronunciations

Downloads

35

Readme

HanjaDict (한자사전)

npm version npm downloads npm bundle size License TypeScript

A lightweight JavaScript/TypeScript package for looking up Hanja (Chinese characters used in Korea) information, specifically focusing on 훈음 (hun-eum).

Installation

npm install hanjadict
# or
yarn add hanjadict

Usage

import { lookup, isHanja, pronunciation, tableData } from "hanjadict"

// Look up a Hanja character
const result = lookup("雪")
console.log(result)
// Output: '눈 설'

// Check if a character is Hanja
const isHanjaChar = isHanja("雪")
console.log(isHanjaChar)
// Output: true

// Get only the pronunciation (음/音) part
const pron = pronunciation("雪")
console.log(pron)
// Output: '설'

// Access the raw dictionary data
console.log(Object.keys(tableData).length)
// Output: 53458

// If the character is not found, returns null
const notFound = lookup("xyz")
console.log(notFound) // Output: null

Features

  • Fast lookups using a pre-compiled dictionary
  • Simple API with intuitive functions
  • Comprehensive dictionary of 53,458 characters
  • Lightweight with no external dependencies
  • TypeScript support
  • Access to raw dictionary data for advanced usage

Available Functions

  • lookup(c): Get the full 훈음 information for a character
  • isHanja(c): Check if a character is a valid Hanja in the dictionary
  • pronunciation(c): Extract only the Sino-Korean pronunciation (음/音) part
  • tableData: Access the raw dictionary data (as a JavaScript object)

What is 훈음 (Hun-eum)?

훈음 (訓音) refers to the combined Korean native word meaning (훈/訓) and Sino-Korean pronunciation (음/音) of a Hanja character. For example:

  • 雪 (눈 설): "눈" is the 훈 (native Korean word for "snow") and "설" is the 음 (Sino-Korean pronunciation)
  • 山 (메 산): "메" is the 훈 (native Korean word for "mountain") and "산" is the 음

This concept is unique to Korean language and helps learners understand both the meaning and pronunciation of Hanja characters.

Special Formats Handled

The pronunciation() function can handle various dictionary formats:

  • Normal format: "눈 설" → returns "설"
  • Comma-separated: "샘솟을 집, 샘솟을 설" → returns "집"
  • Slash-separated: "제비 연/잔치 연" → returns "연"
  • Parentheses: "영양 령(영)" → returns "령"