Skip to content

monkeym4ster/captcha.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

captcha.js

This is a Captcha for Node.js Applications.

Example

中文介绍和使用说明

Just write an example of Express, others have time to come up.

1 2 3 4 5 6 7

Requirements

  • ImageMagick 6.9+
  • Ghostscript 8+

Ubuntu

sudo apt-get install imagemagick ghostscript

Mac OS X

brew install imagemagick ghostscript

Usage

Quick Example

const Captcha = require('captcha.js');
const captcha = new Captcha({length: 5});

captcha.create((err, result) => {
  if(err) throw err;
  console.log(JSON.stringify(result, null, 2));
});

Optional parameter

new Captcha({
  Length: 4, // number of characters generated
  Font_size: 45, // font size
  Implode: 0.4, // text distortion
  Colorful: true, // whether to colorful
  Line: true, // whether to add dry winding
  Cache_limit: 50, // number of caches
  Cache_dir: '/tmp/' // cache folder
});

Releases

No releases published

Packages

No packages published