Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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: **** yeah

redact('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: **** yeah

redact.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)