Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/git-ced/redact
Censors blacklisted words with built in lists of words that can be used.
https://github.com/git-ced/redact
censor filter hacktoberfest profanity-detection profanity-filter redact
Last synced: 27 days ago
JSON representation
Censors blacklisted words with built in lists of words that can be used.
- Host: GitHub
- URL: https://github.com/git-ced/redact
- Owner: git-ced
- License: mit
- Created: 2020-06-25T13:07:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T19:28:56.000Z (almost 2 years ago)
- Last Synced: 2024-10-09T10:49:46.605Z (about 1 month ago)
- Topics: censor, filter, hacktoberfest, profanity-detection, profanity-filter, redact
- Language: TypeScript
- Homepage: https://git-ced.github.io/redact-docs/
- Size: 1.58 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redact
> Censors blacklisted words with built in lists of words that can be used.[![NPM](https://img.shields.io/npm/v/@princedev/redact.svg)](https://www.npmjs.com/package/@princedev/redact)
![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/@princedev/redact)
![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@princedev/redact)
![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/@princedev/redact)
![NPM](https://img.shields.io/npm/l/@princedev/redact)## Table of Contents
- [Installation](#installation)
- [Import](#import)
- [Usage](#usage)
- [Authors](#authors)
- [Changelog](#changelog)
- [License](#license)
## Installation
This library is available through the [npm registry](https://www.npmjs.com/).
NPM
```bash
$ npm -i @princedev/redact
```Yarn
```bash
$ yarn add @princedev/redact
```## Import
Start using it by importing the library first.
### CommonJS
```javascript
const redact = require('@princedev/redact');
```### ES6
```javascript
import { redact } from '@princedev/redact';
```## Usage
**Redact or censor a word from a sentence**
```javascript
import { redact } from '@princedev/redact';const englishProfanity = ['fuck', 'shit', ...];
redact('Fuck yeah', englishProfanity,);
// output: **** yeahredact('Fuck yeah', englishProfanity, {
grawlix: '$',
replaceByLength: false,
});
// output: $ yeah
```**Can also be done in this way.**
```javascript
import redact from '@princedev/redact';const englishProfanity = ['fuck', 'shit', ...];
redact.redact('Fuck yeah', englishProfanity);
// output: **** yeahredact.redact('Fuck yeah', englishProfanity, {
grawlix: '$',
replaceByLength: false,
});
// output: $ yeah
```Read the [docs](https://git-ced.github.io/redact-docs/) for more.
## Authors
- [Prince Neil Cedrick Castro](https://github.com/git-ced/) - Initial work
See also the list of [contributors](https://github.com/git-ced/redact/contributors) who participated in this project.
## Changelog
[Changelog](https://github.com/git-ced/redact/releases)
## License
[MIT](LICENSE)