1.2.0 • Published 8 years ago

grunt-naughty-words v1.2.0

Weekly downloads
9
License
-
Repository
-
Last release
8 years ago

Adapted from Shutterstocks list of Dirty, Naughty, Obscene, and Otherwise Bad Words.

This library provides a grunt task for creating an array of profane words, and a regex to test against, as well as the capability to compile your own obscene word list.

Installation

npm install grunt-naughty-words ---save-dev 

grunt.loadNpmTasks('grunt-naughty-words');

Usage

// creating a list using grunt
bad_words: {
  options: {
    languages: ['en', 'it', 'de'], // english, italian and german        
    varName: 'profanity',
    namespace: 'App'
  },
  all: {
    dest: 'dist/javascript/profanity.js'
  }
}

In JavaScript land, include dist/javascript/profanity.js, which will expose a regex on the namespaced scope (or globally if namespace not provided):

App.profanityRegex.test(potentiallyProfaneWord);

Standalone compilation

You may also build a single one-off file, or one with all languages is provided in the dist directory.

# compile naughty words for English, Italian and German
grunt bad_words:all

Output is found in dist/badwords.js.

Languages

NameCode
Chinesezh
Czechcs
Danishda
Dutchnl
Englishen
Esperantoeo
Finnishfi
Frenchfr
Germande
Hungarianhu
Italianit
Japaneseja
Klingontlh
Koreanko
Norwegianno
Persianfa
Polishpl
Portuguesept
Russianru
Spanishes
Swedishsv
Thaith
Turkishtr

References

Wordlist: © 2012–2015 Shutterstock, Inc.

Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 International License.