npm.io
0.9.4 • Published 9 years ago

captcha-generator

Licence
ISC
Version
0.9.4
Deps
0
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

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. preview

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;

Keywords