hangul-search-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

🇰🇷 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.

/hangul-search-js/

    Package Sidebar

    Install

    npm i hangul-search-js

    Weekly Downloads

    9

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    26.2 kB

    Total Files

    19

    Last publish

    Collaborators

    • hmmhmmhm