1.0.1 • Published 2 years ago

@eyp57tr/captchajs v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Examples for CaptchaJS

const Captcha = require("@eyp57/aptchajs");
const fs = require("fs");
const captcha = new Captcha({
    string: "ThAtS a CaPtChA vAluE", // If not set default is random
    background_color: "YELLOW", // If not set default is a random color
    textColor: "GREEN", // If not set default is "WHITE"
    length: 6 // If not set default is 5
});

captcha.getString() // Get the captcha value
captcha.check("3213") // Check the captcha with a string
const buffer = captcha.getBuffer() // Get the canvas buffer

fs.writeFileSync('./image.png', buffer); // Writes the buffer to the PNG file

More examples in github page:

Github - NPMJS