https://github.com/dext7r/badwords
https://github.com/dext7r/badwords
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dext7r/badwords
- Owner: dext7r
- License: mit
- Created: 2024-06-08T15:45:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T16:54:49.000Z (about 2 years ago)
- Last Synced: 2024-10-11T10:49:55.044Z (over 1 year ago)
- Language: JavaScript
- Size: 78.1 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @h7ml/badwords
[](https://www.npmjs.com/package/@h7ml/badwords)
[](https://github.com/h7ml/badwords/blob/main/LICENSE)
[](https://github.com/h7ml/badwords/)
[](https://github.com/h7ml/badwords/fork)
[](https://github.com/h7ml/badwords)
# Install
## npm
```bash
npm install @h7ml/badwords
```
## yarn
```bash
yarn add @h7ml/badwords
```
## pnpm
```bash
pnpm add @h7ml/badwords
```
# usage
## import
```js
import {badwords, checkWord} from '@h7ml/badwords'
```
## check
```js
checkWord('天府广场', badwords) // true
checkWord('广场') // false
```
## API
### checkWord(text, words)
| parameter | type | default | require | description |
|-----------|-------------|------------|---------|---------------------------|
| `text` | `string` | `_` | `true` | To check the text |
| `words` | `string[]` | `badwords` | `false` | Sensitive vocabulary list |
# License
[MIT](./LICENSE) License © 2023 [h7ml](https://github.com/h7ml)