It allows you to search for simple Korean characters in the most consistent order regardless of the character assembly order.
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: ['난가']
<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: ['난가']
MIT Licensed.