https://github.com/hwahyeon/korean-stroke
A JavaScript library for calculating the total stroke count of Korean characters in a string
https://github.com/hwahyeon/korean-stroke
character-analysis hangeul hangul javascript korean npm stroke
Last synced: 5 days ago
JSON representation
A JavaScript library for calculating the total stroke count of Korean characters in a string
- Host: GitHub
- URL: https://github.com/hwahyeon/korean-stroke
- Owner: hwahyeon
- License: mit
- Created: 2024-02-21T12:55:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-08T23:51:26.000Z (11 months ago)
- Last Synced: 2025-08-09T01:16:51.358Z (11 months ago)
- Topics: character-analysis, hangeul, hangul, javascript, korean, npm, stroke
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/korean-stroke
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# korean-stroke
**korean-stroke** is a lightweight JavaScript library that calculates the total stroke count of Korean (Hangul) characters in a string.
## Installation
```bash
npm install korean-stroke
```
## Usage
### CommonJS
```javascript
const strokeCounter = require('korean-stroke');
console.log(strokeCounter('안녕')); // 11
```
### ES Modules
```javascript
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