A modern JavaScript Hangul library

💡

es-hangul is a small JavaScript library that helps you conveniently handle Hangul. It provides a convenient and clean API for actions such as searching for initial consonants and attaching particles.

import { chosungIncludes } from 'es-hangul';
 
const searchWord = '라면';
const userInput = 'ㄹㅁ';
 
const result = chosungIncludes(searchWord, userInput);
console.log(result); // true
import { josa } from 'es-hangul';
 
const word1 = '사과';
const sentence1 = josa(word1, '을/를') + ' 먹었습니다.';
console.log(sentence1); // '사과를 먹었습니다.'
 
const word2 = '바나나';
const sentence2 = josa(word2, '이/가') + ' 맛있습니다.';
console.log(sentence2); // '바나나가 맛있습니다.'