1.1.1 • Published 2 years ago

@sparkedscience/content-blocker v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

ContentBlocker

A Vanilla JS package to check user input

Installation

npm i @sparkedscience/content-blocker

Usage

import ContentBlocker from '@sparkedscience/content-blocker';

// Object creation
let cb = new ContentBlocker("en");
// OR
let cb = new ContentBlocker("en", "hello, world");

//Check if the input is valid
cb.check(input); // Returns a boolean. True is valid, false is invalid.

Currently, the following languages are supported: English (en), Spanish (es), Italian (it), and Indonesian (id).

New to version 1.1.0: Adds support for an optional custom word list. The constructor accepts a comma seperated list of words to use in the filter.

NPM Script

npm run demo

This is the only script right now. It will open a new tab with the demo page.