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 🙏

© 2026 – Pkg Stats / Ryan Hefner

korean-pronunciation

v1.0.1

Published

Korean grapheme-to-phoneme converter (g2p). Converts written Korean (Hangul) to its pronunciation.

Downloads

243

Readme

korean-pronunciation

Korean grapheme-to-phoneme converter for Node.js. Converts written Korean (Hangul) into its pronunciation.

This is a Node.js port of g2pK by Kyubyong Park.

Features

  • Implements all 30 Korean Standard Pronunciation Rules
  • English word transliteration (using CMU Pronouncing Dictionary)
  • Arabic numeral to Korean conversion (Sino-Korean & Pure Korean)
  • Idiom/exception handling
  • Descriptive (colloquial) pronunciation mode
  • Zero runtime dependencies - pure JavaScript

Installation

npm install korean-pronunciation

Usage

const { G2p } = require('korean-pronunciation');

const g2p = new G2p();

// Basic conversion
console.log(g2p.convert('있다'));       // 읻따
console.log(g2p.convert('먹는'));       // 멍는
console.log(g2p.convert('좋다'));       // 조타
console.log(g2p.convert('같이'));       // 가치
console.log(g2p.convert('합니다'));     // 함니다

// English words are automatically converted to Hangul
console.log(g2p.convert('mp3'));        // 엠피쓰리
console.log(g2p.convert('file'));       // 파일
console.log(g2p.convert('game'));       // 게임

// Numbers before counter words use pure Korean
console.log(g2p.convert('3개'));        // 세개

// Mixed text
console.log(g2p.convert('나의 친구가 mp3 file 3개를 다운받고 있다'));
// 나의 친구가 엠피쓰리 파일 세개를 다운받꼬 읻따

TypeScript

import { G2p, G2pOptions } from 'korean-pronunciation';

const g2p = new G2p();

const options: G2pOptions = {
  descriptive: true,  // colloquial pronunciation
  verbose: false,     // show conversion steps
  groupVowels: false, // normalize similar vowels
  toSyl: true,        // assemble jamo into syllables
};

console.log(g2p.convert('나의 친구', options));
// 나에 친구 (descriptive: 의 as particle → 에)

API

new G2p()

Creates a new G2p instance. Loads the pronunciation rule table, CMU dictionary, and idiom list.

g2p.convert(text, options?)

Converts Korean text to its pronunciation.

Parameters:

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | text | string | | Input Korean text | | options.descriptive | boolean | false | Use colloquial pronunciation rules | | options.verbose | boolean | false | Print conversion process to console | | options.groupVowels | boolean | false | Normalize similar vowels (ㅐ→ㅔ, ㅒ→ㅖ) | | options.toSyl | boolean | true | Assemble jamo into syllable blocks |

Returns: string - The pronunciation of the input text.

Pronunciation Rules Implemented

The converter implements all 30 rules of Korean Standard Pronunciation:

  • Rules 5.1-5.4: Vowel rules (ㅖ, ㅢ)
  • Rule 9: Final consonant neutralization (ㄲ,ㅋ→ㄱ; ㅅ,ㅆ,ㅈ,ㅊ,ㅌ→ㄷ; ㅍ→ㅂ)
  • Rules 10-11: Compound coda simplification
  • Rule 12: ㅎ aspiration
  • Rules 13-15: Consonant linking
  • Rule 16: Hangul letter names
  • Rule 17: Palatalization (ㄷ+ㅣ→ㅈ)
  • Rule 18: Nasal assimilation
  • Rules 19-20: ㄹ assimilation
  • Rules 23-27: Consonant hardening (tensification)
  • Rules 28-30: Sai-siot rules

Additional Exports

const { h2j, j2h, compose, processNum, convertNum, convertEng } = require('korean-pronunciation');

// Hangul decomposition/composition
h2j('한글');     // '한글' (decompose to jamo)
j2h('ᄒ','ᅡ','ᆫ'); // '한' (compose jamo to syllable)

// Number conversion
processNum('123', true);   // '백이십삼' (Sino-Korean)
processNum('3', false);    // '세' (Pure Korean)

License

Apache License 2.0 (same as original g2pK)

Credits

  • Original Python library by Kyubyong Park
  • CMU Pronouncing Dictionary by Carnegie Mellon University