naughty-string-validator
v1.1.0
Published
Get naughty strings from an offline db of big list of naughty strings and emojis
Downloads
547
Maintainers
Readme
naughty-string-validator
A node.js library that returns naughty strings
from an offline database of Big List of Naughty Strings and emojis. The db will be continuously growing with each release.
The Big List of Naughty Strings is an evolving list of strings which have a high probability of causing issues when used as user-input data.
This library can be inluded in the test automation framework for API, UI, or DB testing to validate them against naughty strings.
Installation
npm install naughty-string-validator
Usage
var naughty = require('naughty-string-validator');
To get a random naughty string from the list
var randomNaughty = naughty.getRandomNaughtyString(); //randomNaughty "<a href=\"\\xE2\\x80\\x88javascript…(1)\" id=\"fuzzelement1\">test</a>"
To get entire naughty string list
var naughtyList = naughty.getNaughtyStringList(); //naughtyList ["", "undefined", "undef", "null", "NULL", "(null)", "nil", …]
To get a random emoji from the emoji list
var randomEmoji = naughty.getRandomEmoji(); //randomEmoji "😃"
To get a entire emoji list
var emojiList = naughty.getEmojiList(); //emojiList ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣", "☺️", "😊", …]
- To get emoji list of a particular category:
'People', 'Nature', 'Foods', 'Activity', 'Places', 'Objects', 'Symbols', 'Flags'
var emojiList = naughty.getEmojiList('Flags'); //emojiList ['🏳️', '🏴', '🏁', '🚩', '🏳️🌈', '🇦🇫', '🇦🇽','🇦🇱', …]
- To get emoji list of a particular category:
Tests
//To run test with linting but without coverage
npm test
//Test with coverage
npm run cover
☑ Roadmap
- [x] Add Support for emoji
- [ ] Add Support to get a desired emoji by name
- [ ] Add Support to get NaughtyStringList of a given length
- [ ] Add Support for mocha and chai integration
- [ ] Add Support to get list of stickers
If you think you can contribute to any of the roadmap or suggest something new, you can contribute to this project by opening a pull request.