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

@mornya/korean-libs

v1.3.0

Published

The project of Korean process module.

Downloads

159

Readme

Korean Libs

npm node types downloads license

The project of Korean process module.

This project has been created by Vessel CLI. For a simple and quick reference about it, click here.

About

한글/공휴일 처리 라이브러리.

Installation

해당 모듈을 사용할 프로젝트에서는 아래와 같이 설치한다.

$ npm install --save @mornya/korean-libs
or
$ yarn add @mornya/korean-libs

Usage

아래와 같이 사용 할 모듈을 import 하여 사용한다.

import { Convert, Extract, Hangul, Holidays } from '@mornya/korean-libs';

/* ... */

Modules in the package

본 패키지에는 아래와 같은 모듈들을 포함한다. 제공되는 모듈과 메소드 사용법 등은 코드 스니핏을 참고한다.

Convert module

변환에 관련된 모듈

digit2Korean

소수점을 포함한 숫자를 한글로 변환한다. delimiter는 단위 사이를 구분하는 문자열.

정수는 무량대수까지만 표현 가능하다.

function digit2Korean (value: BigInteger | number, delimiter: string): string {}

percent2Korean

0과 1 사이의 값을 할푼리로 변환하여 문자열을 리턴한다. delimiter는 단위 사이를 구분하는 문자열.

BigInteger형을 입력받지만 일반적으로 number를 사용하므로 소수점 17자리까지 처리된다.

function percent2Korean (value: BigInteger | number, delimiter: string): string {}

Extract module

getPhonemes

입력한 한글을 초/중/종성을 추출하여 리턴한다.

UTF-8로 인코딩 된 문자열만 처리 가능.

function getPhonemes (value: string): IExtractedPhoneme[] {}

Hangul module

isContainsKorean

입력한 텍스트에 한글 문자가 포함되어 있는지 여부를 체크한다.

UTF-8로 인코딩 된 문자열만 처리 가능.

function isContainsKorean (value: string): boolean {}

hasJongseong

한글 텍스트의 마지막 글자가 종성(받침)을 갖고 있는지 여부를 체크.

function hasJongseong (value: string): boolean {}

getAppendedJosa

입력한 한글의 조사를 판별하여 결과 값을 리턴한다.

  • 텍스트의 마지막 글자가 영문(aeiou) 혹은 한글 종성(받침)을 가지고 있을 때 0번 인덱스의 주어진 조사를 붙여 리턴.
  • 종성을 갖고 있지 않으면 1번 인덱스의 조사를 붙여 리턴.
  • ex) '한글', ['은','는'] => '한글은'
function getAppendedJosa (value: string, josa: string[], isFullText: boolean): string {}

Holidays module

getList

대한민국 공휴일 및 휴일 정보를 배열로 매핑하여 전체 공휴일 정보를 리턴한다. yearly 파라미터는 부가적인 휴일 정보를 배열로 전달할 수 있으며, 기본 공휴일 정보에 추가(merge)된다. (ex. [{ date: '2018-12-31', name: '연말', isSubst: false }, ...])

현재 2021년 ~ 2032년 까지의 공휴일 및 휴일 정보가 기본적으로 등록되어 있음.

function getList(yearly?: Holiday[]): Holiday[] {}

Change Log

프로젝트 변경사항은 CHANGELOG.md 파일 참조.

License

프로젝트 라이센스는 LICENSE 파일 참조.