wb-captcha

0.4.0 • Public • Published

captcha

A Lightweight Pure JavaScript Captcha for Node.js. No C/C++, No ImageMagick, No canvas. Inspired By rucaptcha.

Installation

$ npm install git+ssh://git@gitlabce.wbiaotest.cn/nodejs/wb-captcha.git --save

Examples

'use strict'

const fs = require('fs')
const captcha = require('wb-captcha')

const { token, buffer } = yield captcha({ size: 4, style: -1 });

ctx.set('Content-Type', "image/png");
ctx.body = buffer;

API

captcha({ size: 5, style: -1 })

  • size: Defaults to 5.
  • style: Defaults to -1 with random.
// returns
{
  token,
  buffer
}

Readme

Keywords

Package Sidebar

Install

npm i wb-captcha

Weekly Downloads

1

Version

0.4.0

License

MIT

Unpacked Size

49.5 kB

Total Files

9

Last publish

Collaborators

  • wbiaotech