Socket
Book a DemoInstallSign in
Socket

spam-check

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spam-check

Module for checking for spam words

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
249
-36.15%
Maintainers
1
Weekly downloads
 
Created
Source

spamCheck

Node.js CI Known Vulnerabilities

A simple node module for checking for spam in user inputs. This module comes with a full list of spam words!

Installation

npm install spam-check

Usage

var spamCheck = require('spam-check');
var options = {'string':'poop'};
spamCheck(options, function(err, results) {
  console.log("err:",err);
  console.log("results:",results);
});

You can also set a type flag for either full matches or partial matches. Below is an example for a partial match.

var spamCheck = require('spam-check');
var options = {'string':'wordspoopwords','type':'part'};
spamCheck(options, function(err, results) {
  console.log("err:",err);
  console.log("results:",results);
});

Results

Check the return for a err flag. If err is set to true, then the input was invalid. Otherwise it will be set to false. The above example will return something like...

{ spam: true }

Tests

You have to have mocha running. To install it run...

npm install mocha -g

Then you can run the tests by turning on the server and run...

mocha tests/

TODO

-Add other Validation rules

Keywords

spam check

FAQs

Package last updated on 01 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.