Skip to content

hwahyeon/korean-stroke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

korean-stroke

korean-stroke is a lightweight JavaScript library that calculates the total stroke count of Korean (Hangul) characters in a string.

Installation

npm install korean-stroke

Usage

CommonJS

const strokeCounter = require('korean-stroke');

console.log(strokeCounter('안녕')); // 11

ES Modules

import strokeCounter from 'korean-stroke'

console.log(strokeCounter('안녕')); // 11

Note: The strokeCounter function calculates the stroke count for Korean characters only. Any non-Korean characters in the input string will not be counted towards the total stroke count.

API

strokeCounter(string)

  • Parameters
    • string (String): The Korean string to calculate strokes for.
  • Returns
    • Number: Total stroke count of Korean characters in the input string.

License

MIT License

About

A JavaScript library for calculating the total stroke count of Korean characters in a string

Topics

Resources

License

Stars

Watchers

Forks

Contributors