A Lightweight Pure JavaScript Captcha for Node.js. No C/C++, No ImageMagick, No Canvas.
Switch branches/tags
Clone or download
Latest commit 5d31312 Jul 15, 2018
Permalink
Failed to load latest commit information.
lib prettier Aug 30, 2017
test refactor with pure js Mar 19, 2017
.gitignore Bump v0.2.0 Feb 6, 2017
.travis.yml ci: add node v8 Sep 7, 2017
LICENSE Bump v0.2.0 Feb 6, 2017
README.md ddeps: update Aug 30, 2017
appveyor.yml refactor with pure js Mar 19, 2017
index.d.ts Update index.d.ts Jul 12, 2018
package-lock.json ddeps: update Aug 30, 2017
package.json Bump v0.4.0 Aug 30, 2017

README.md

captcha

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

Installation

$ npm install trek-captcha --save

Examples

'use strict'

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

async function run() {
  const { token, buffer } = await captcha()

  // console.log(token, buffer)

  fs.createWriteStream('a.gif').on('finish', () => console.log(token)).end(buffer)
}

run()

API

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

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

Badges

Linux Windows codecov


fundon.me  ·  GitHub @fundon  ·  Twitter @_fundon