Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ redact Public

Censors blacklisted words with built in lists of words that can be used.

License

Notifications You must be signed in to change notification settings

git-ced/redact

Repository files navigation

redact

Censors blacklisted words with built in lists of words that can be used.

NPM npm bundle size (scoped) npm bundle size (scoped version) Libraries.io dependency status for latest release, scoped npm package NPM

Table of Contents

Installation

This library is available through the npm registry.

NPM

$ npm -i @princedev/redact

Yarn

$ yarn add @princedev/redact

Import

Start using it by importing the library first.

CommonJS

const redact = require('@princedev/redact');

ES6

import { redact } from '@princedev/redact';

Usage

Redact or censor a word from a sentence

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.

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 for more.

Authors

See also the list of contributors who participated in this project.

Changelog

Changelog

License

MIT

About

Censors blacklisted words with built in lists of words that can be used.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /