# enyg

> ENYG.js

Latest version **0.3.0** (published 2020-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install enyg
pnpm add enyg
yarn add enyg
bun add enyg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-04-20 |
| First published | 2020-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | hsh2001 |
| Maintainers | hsh0084 |
| Keywords | korean |

## Links

- npm: https://www.npmjs.com/package/enyg
- Repository: https://github.com/hsh2001/enyg.js
- Homepage: https://github.com/hsh2001/enyg.js#readme
- Issues: https://github.com/hsh2001/enyg.js/issues
- npm.io page: https://npm.io/package/enyg

## Dependencies (1)

- [typescript](https://npm.io/package/typescript.md) ^3.8.3

## Recent versions

- 0.3.0 (latest) — 2020-04-20
- 0.2.1 — 2020-04-11
- 0.2.0 — 2020-01-24
- 0.1.0 — 2020-01-21
- 0.0.1 — 2020-01-20

## README

# enyg.js
은는이가.js

```bash
npm i enyg
```

- enyg: \[은|는\], \[이|가\] 등의 조사를 문법에 맞게 선택해줍니다.

  ```javascript  
  import enyg from 'enyg';

  enyg("그것[은|는] 왜") === "그것은 왜";
  enyg("너[이|가] 나[을|를]?") === "너가 나를?";
  ```

  다음의 조사들이 문법에 맞게 대체됩니다.
  - `[은|는]`
  - `[이|가]`
  - `[을|를]`
  - `[와|과]`


- hangulDecompose: 한글을 초성, 중성, 종성으로 분해합니다.

  ```javascript
  import { hangulDecompose } from 'enyg';
  ```

  ```javascript
  const {
    char,
    chosung,
    jungsung,
    jongsung,
  } = hangulDecompose("꽃");

  char === "꽃";
  chosung === "ㄲ";
  jungsung === "ㅗ";
  jongsung === "ㅊ";
  ```

  가 ~ 힣 사이의 문자가 아닐 경우, char 프로퍼티만 갖는 객체를 반환합니다.

  ```javascript
  hangulDecompose("ㅎ"); // { char: "ㅎ" }

  [
    ..."ㄱㅎㅏㅣ abcd 123 こんにちは。"
  ] // [ "ㄱ", "ㅎ", "ㅏ", ... ]
  .map(hangulDecompose) // [ {...}, {...}, {...}, ... ]
  .every(
    element => (
      !element.chosung &&
      !element.jungsung &&
      !element.jongsung
    )
  ); //true
  ```

- toChosung, toJungsung, toJongsung: 문자열을 초성, 중성, 종성으로 매핑합니다. 가 ~ 힣 사이의 문자만 변환됩니다.

  ```javascript
  import { toChosung } from 'enyg';

  toChosung("오늘의 기온은 20℃"); // "ㅇㄴㅇ ㄱㅇㅇ 20℃"
  toChosung("ㅋㅋㅋㅋ 진짜?"); // "ㅋㅋㅋㅋ ㅈㅉ?"
  toChosung("Hello world!"); // "Hello world!"
  toChosung("ㅏㅔㅣㅗㅜ를 읽어봐."); // "ㅏㅔㅣㅗㅜㄹ ㅇㅇㅂ."
  ```  

# 라이센스
MIT

---
_Source: https://npm.io/package/enyg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
