1.0.1 • Published 9 months ago
@mr_fozan/captcha v1.0.1
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)