Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 1.9 KB

README.md

File metadata and controls

75 lines (54 loc) · 1.9 KB

🇰🇷 Hangul Search Js

It allows you to search for simple Korean characters in the most consistent order regardless of the character assembly order.

Github Workflow GitHub License Jest Coverage Gzip Size TypeScript NPM Version jsDelivr


📦 Usage (ES5+)

npm i hangul-search-js
import { createSearch } from 'hangul-search-js'

const search = createSearch([
  '롯데시네마',
  '유튜브',
  '프로게이머',
  '가난',
  '난가'
])

const result = search('시ㄴ')
// result: ['롯데시네마', '프로게이머', '가난', '난가']

const resultExact = search('시ㄴ', { exact: true })
// result: ['롯데시네마']

const resultExact = search('난가', { exact: true, order: true })
// result: ['난가']

📦 Usage (CDN)

<script src="https://cdn.jsdelivr.net/npm/hangul-search-js/export/hangul-search.js"></script>
var createSearch = window.hangulSearch

var search = createSearch([
  '롯데시네마',
  '유튜브',
  '프로게이머',
  '가난',
  '난가'
])

var result = search('시ㄴ')
// result: ['롯데시네마', '프로게이머', '가난', '난가']

var resultExact = search('시ㄴ', { exact: true })
// result: ['롯데시네마']

var resultExact = search('난가', { exact: true, order: true })
// result: ['난가']

💡 License

MIT Licensed.