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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hangeul-js

v1.0.3

Published

A JavaScript library for working with the Korean alphabet, Hangeul.

Downloads

19

Readme

Hangeul-js

Hangeul-js는 한글을 다루기 위한 간단한 라이브러리로, 여러 유용한 한글 관련 유틸 함수들을 제공합니다.

Hangeul-js is an simple library that provids useful util functions for manipulating the Korean Alphabet, Hangeul

Installing

$ npm install hangeul-js

Usage

cjs

const { isHangeul } = require("hangeul-js");

esm

import { isHangeul } from "hangeul-js";

Util Functions

isJaeum

  • 문자가 한글 자음인지 여부를 반환합니다.
  • Returns whether a given string is a Korean consonant(Jaeum) or not.
isJaeum("김"); // true
isJaeum("ㄱ"); // true
isJaeum("ㅏ"); // false
isJaeum("a"); // false
isJaeum("."); // false

isMoeum

  • 문자가 한글 모음인지 여부를 반환합니다.
  • Returns whether a given string is a Korean vowel(Moeum) or not.
isMoeum("김"); // false
isMoeum("ㄱ"); // false
isMoeum("ㅏ"); // true
isMoeum("a"); // false
isMoeum("."); // false

isHangeulJamo

  • 문자가 한글 자음이거나 모음인지 여부를 반환합니다.
  • Returns whether a given string is either a Korean consonant or vowel or not.
isHangeulJamo("김"); // false
isHangeulJamo("ㄱ"); // true
isHangeulJamo("ㅏ"); // true
isHangeulJamo("a"); // false
isHangeulJamo("."); // false

isHangeulSyllable

  • 문자가 한글 음절인지 여부를 반환합니다.
  • Returns whether a given string is a Korean syllable or not.
isHangeulJamo("김"); // true
isHangeulJamo("ㄱ"); // false
isHangeulJamo("ㅏ"); // false
isHangeulJamo("a"); // false
isHangeulJamo("."); // false

isHangeul

  • 문자가 한글인지 여부를 반환합니다.
  • Returns whether a given character is Korean or not.
isHangeul("김"); // true
isHangeul("ㄱ"); // true
isHangeul("ㅏ"); // true
isHangeul("a"); // false
isHangeul("."); // false

isValidChosung

  • 문자가 유효한 초성 자음인지 여부를 반환합니다.
  • Returns whether a given character is a valid Chosung or not.
isValidChosung("ㄱ"); // true
isValidChosung("ㅉ"); // true
isValidChosung("ㄵ"); // false

isValidJongsung

  • 문자가 유효한 종성 자음인지 여부를 반환합니다.
  • Returns whether a given character is a valid jongsung or not.
isValidJongsung("ㄱ"); // true
isValidJongsung("ㅉ"); // false
isValidJongsung("ㄵ"); // true

hasJongsung

  • 문자가 종성이 있는 한글음절인지 여부를 반환합니다.
  • Returns whether a given character is a Korean syllable with a trailiing consonant.
hasJongsung("김"); // true
hasJongsung("기"); // false

getChosung

  • 음절의 초성을 반환합니다.
  • Returns the Chosung of a given korean Syllable.
getChosung("김"); // "ㄱ"

getJungsung

  • 음절의 중성을 반환합니다.
  • Returns the jungsung of a given korean Syllable.
getJungsung("김"); // "ㅣ"

getJongsung

  • 음절의 종성을 반환합니다.
  • 종성이 없는 경우 빈 문자열을 반환합니다.
  • Returns the jongsung of a given korean Syllable.
  • Returns an empty string when it has no jongsung.
getJongsung("김"); // "ㅁ"

assemble

  • 한글 자음과 모음의 배열을 받아 한글 음절들로 조합합니다.
  • Assembles given array of korean alphabets into syllables.
assemble(["ㄱ", "ㅣ", "ㅁ"]); // "김"

disassemble

  • 문자열을 받아 한글 음절의 배열로 분리합니다.
  • Disassembles given string of korean syllables into an aray of korean alphabets.
disassemble("김"); // ["ㄱ", "ㅣ", "ㅁ"]