https://github.com/gnlow/ehyu.js
Hangul Jamo Replacer
https://github.com/gnlow/ehyu.js
hangul
Last synced: 6 months ago
JSON representation
Hangul Jamo Replacer
- Host: GitHub
- URL: https://github.com/gnlow/ehyu.js
- Owner: gnlow
- Created: 2019-08-11T12:10:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-19T06:07:09.000Z (over 4 years ago)
- Last Synced: 2025-05-30T01:49:42.653Z (8 months ago)
- Topics: hangul
- Language: TypeScript
- Homepage:
- Size: 268 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ehyu.js
Hangul jamo replacer
```js
var text = new ehyu.Gljas("안녕, 새로운 세상");
text.replace("ㅔ", "ㅐ", {lock: true})
.replace("ㅐ", "ㅔ");
console.log(text.content);
// 안녕, 세로운 새상
```
## Installation
### NPM
```bash
npm install ehyu
```
```js
const ehyu = require("ehyu");
```
### CDN
```html
```
## How To Use
```js
var text = new ehyu.Gljas("바꿀 글");
```
### Simple Replace
```js
text.replace("ㄱ", "ㄴ");
//바꿀 늘
```
### Multiple Replace
```js
var text = new ehyu.Gljas("네모네모 멍뭉이의 저주");
text.replace("ㅇ", "ㅁ")
.replace("ㅎ", "ㅍ");
// or
text.replace(["ㅇ", "ㅎ"], ["ㅁ", "ㅍ"]);
// or
text.replace("ㅇㅎ", "ㅁㅍ");
```
### Option
```js
text.replace("ㄱ", "ㄴ",{
target: "coda",
// "onset"(초성), "nucleus"(중성), "coda"(종성)
// 설정 시 해당하는 자모만 변경
lock: true
// 기본값: false
// true로 설정 시 변경된 자모는 다시 바뀌지 않음
});
```