@mr_fozan/captcha
v1.0.1
Published
<h1 align="center">๐ Captcha</h1>
Downloads
5
Readme
Captcha is a Node.js module that will allow you to create a captcha session
๐ฆ Install
NPM
npm instal @mr_fozan/captcha
YARN
$ yarn add @mr_fozan/captcha
๐ Usage
const captcha = require('@mr_fozan/captcha');
๐ Documentation
Creating a captcha
const captcha = require('@mr_fozan/captcha');
const cpt = new captcha({ variations: 3 });
const generate = cpt.generate();
console.log(generate);
The request will return the following data
- id - captcha id
- answer - correct captcha answer
- variations - list of answer options (one of them is correct)
Checking captcha input
const captcha = require('@mr_fozan/captcha');
const cpt = new captcha({ variations: 3 });
var captchaId = 001;
var userInput = "๐ซ";
const verify = cpt.verify(captchaId, userInput);
console.log(verify);
The data that is needed in the argument
- id - captcha id
- answer - user response
The request will return the following data
- response - Boolean (If the captcha is correct, then true, if not, then false)
๐ฅ Contributors
License
The MIT License (MIT)