Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

no-swears

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-swears

Filter swearwords out of your strings automagically

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

no-swears

Automagically filter out swear words in strings

npm version

Very simple package for censoring swear words from JavaScript strings, replacing offending words with "****".

Usage

'use strict'

const noswears = require('no-swears')

filter()

This is the most basic filtering function, and requires the offending string and a callback, returning the cleaned up string to the program.

let badString = "this is a bitching string"

noswears.filter(badString, goodString => {
	console.log(goodString) // "this is a ****ing string"
})

hasSwears()

This just returns true or false to callback depending on whether the passed string contains a swear word

let badString = "this is a bitching string"

noswears.hasSwears(badString, swearBool => {
	console.log(swearBool) // true
})

Keywords

FAQs

Package last updated on 02 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc