An open API service indexing awesome lists of open source software.

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

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