# contains-chinese

> Checks whether the input string contains any Chinese text (at least one character). Works with Traditional and Simplified. Unlike the is-chinese package, returns `true` even if the string contains mixed Chinese and non-Chinese characters.

Latest version **1.0.0** (published 2017-10-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install contains-chinese
pnpm add contains-chinese
yarn add contains-chinese
bun add contains-chinese
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-10-23 |
| First published | 2017-10-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Anton Ivanov |
| Maintainers | anton-ivanov |
| Keywords | chinese, is-chinese, has-chinese, contains-chinese, chinese-language, traditional-chinese, simplified-chinese, regex, regexp, han, hanzi, characters, zhongwen, zh, zh-HK, 6-4, cantonese, mandarin |

## Links

- npm: https://www.npmjs.com/package/contains-chinese
- Repository: https://github.com/catcher-in-the-try/contains-chinese
- Homepage: https://github.com/catcher-in-the-try/contains-chinese#readme
- Issues: https://github.com/catcher-in-the-try/contains-chinese/issues
- npm.io page: https://npm.io/package/contains-chinese

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-10-23

## README

Check whether a string contains any Chinese text
===================

### Short sample ###

```js
const containsChinese = require('contains-chinese');

let t = containsChinese('香港 is cool'); // true
let f = containsChinese('홍콩'); // false - not Chinese

```

### What's it for? ###

This package provides a way to check whether a string contains any Chinese
text. The function will return `true` if there is at least one Chinese 
character in the string. 

### Difference from `is-chinese` ###

Another package called `is-chinese` will return false if the string contains
at least one non-Chinese character, for example `Welcome to 香港` will 
result in `false`.

In contrast, this package will return `true` for such text containing mixed
Chinese and non-Chinese text.

### Methods and Static Members ###

* `containsChinese` - returns `true` if the string has any Chinese characters.
* `containsChinese.HAN_REGEX` - contains the regex used for this check.

### Comments and suggestions ###

If you have any comments, contact me here: https://github.com/catcher-in-the-try/

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