Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including f-ck with all npm packages installed. Try it out:

var fCk = require("f-ck")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

f-ck v1.0.5

Clean-up cuss words

f-ck

Build Coverage Downloads Size

Clean-up cuss (c*ss, c**s, @#$%) words.

Not affiliated with Football Club København.

Install

npm:

npm install f-ck

Use

var fck = require('f-ck')

console.log(fck('butt')) // => 'b*tt'
console.log(fck.vowel('butt')) // => 'b*tt'
console.log(fck.inner('butt')) // => 'b**t'
console.log(fck.grawlix('butt')) // => '@#$%'
console.log(fck.grawlix(7)) // => '@#$%!&?'

console.log(fck('butt', '-')) // => 'b-tt'

API

fck(value[, character])

fck.vowel(value[, character])

Sanitize value by replacing vowels in value with character (default: '*').

fck.inner(value[, character])

Sanitize value by replacing all characters except the first and last in value with character (default: '*').

fck.grawlix(value[, pattern])

Sanitize value using a grawlix pattern (default: '@#$%!&?'). Essentially, repeats pattern for value (when number) / value.length (when string) characters.

Related

  • profanities — List of (possible) English profane words
  • cuss — Map of English profane words to a rating of sureness

License

MIT © Titus Wormer

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free