JSPM

hangul-search-js

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 27
  • Score
    100M100P100Q53963F
  • License MIT

Simple Korean text search module

Package Exports

  • hangul-search-js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hangul-search-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

πŸ‡°πŸ‡· 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.