# pinyin-so

> ⚠️⚠️⚠️ 目前为非稳定版本

Latest version **0.0.7** (published 2020-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install pinyin-so
pnpm add pinyin-so
yarn add pinyin-so
bun add pinyin-so
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-05-17 |
| First published | 2020-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 84 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ReAlign |
| Maintainers | realign |
| Keywords | pinyin, chinese, 拼音, 全拼, 简拼, 同音字, match, so, search, 拼音搜, 拼音搜索, 中文搜索 |

## Links

- npm: https://www.npmjs.com/package/pinyin-so
- Homepage: https://github.com/ReAlign/pinyin-so#readme
- Issues: https://github.com/ReAlign/pinyin-so/issues
- npm.io page: https://npm.io/package/pinyin-so

## Recent versions

- 0.0.7 (latest) — 2020-05-17
- 0.0.6 — 2020-05-17
- 0.0.5 — 2020-05-17
- 0.0.4 — 2020-05-17
- 0.0.3 — 2020-05-17
- 0.0.2 — 2020-05-17
- 0.0.1 — 2020-05-17
- 0.0.0 — 2020-05-04

## README

# pinyin-so

⚠️⚠️⚠️ 目前为非稳定版本

[![NPM version][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/pinyin-so.svg?longCache=true&style=for-the-badge
[npm-url]: https://www.npmjs.com/package/pinyin-so

> 拼音搜索方案，支持 全拼/简拼/同音字 等。

## Demo

[demo](https://realign.github.io/pinyin-so/code/demo/build)

## Usage

```js
import PinyinSo from 'pinyin-so';

/**
 * @name    PinyinSo.so
 * @param   {String}    targetStr   待搜索文本
 * @param   {String}    keyword     搜索关键词
 * @returns {Boolean | Array}       失败结果 或者 结果索引
 */
const res = PinyinSo.so(`${targetStr}`, `${keyword}`);
if(res) {
  const [start, end] = res;
} else {
  console.log('No matching results.');
}
```

## 待办

* [ ] 优化代码
* [ ] 发新版

## 参考

[xmflswood/pinyin-match](https://github.com/xmflswood/pinyin-match)

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