naughty-string-validator

1.1.0 • Public • Published

naughty-string-validator

Build Status Coverage Status npm version npm dependencies Status devDependencies Status Known Vulnerabilities License: MIT

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
    ['🏳️', '🏴', '🏁', '🚩', '🏳️‍🌈', '🇦🇫', '🇦🇽','🇦🇱', …]

Tests

//To run test with linting but without coverage
npm test
 
//Test with coverage
npm run cover

☑ Roadmap

  • 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.

Package Sidebar

Install

npm i naughty-string-validator

Weekly Downloads

32

Version

1.1.0

License

MIT

Unpacked Size

413 kB

Total Files

9

Last publish

Collaborators

  • shashikumarraja