captcha-generator
v0.9.4
Published
Production image verification code by jpeglib
Downloads
63
Maintainers
Readme
Install
$ npm install --save captcha-generator
Overview
This is a captcha generator that can only generate image verification code because I do not like ccap, ccap uses not only trouble but also low performance and easy memory leak. captcha-generator can also be used across platforms.
Usage
import {generate, createPlaintext} from "captcha-generator"
Get the verification code by default
const cimg = generate();
const {base64, plaintext, buffer, imageType} = cimg;
Customize picture content and width and height
const cimg = generate({
text: createPlaintext(6),
width: 500,
height: 200,
fontSize: 200
} );
const {base64, plaintext, buffer, imageType} = cimg;