npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

naughty-string-validator

v1.1.0

Published

Get naughty strings from an offline db of big list of naughty strings and emojis

Downloads

221

Readme

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

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