captcha.js
v1.0.5
Published
Captcha in Node.js
Downloads
7
Readme
captcha.js
This is a Captcha for Node.js Applications.
Example
Just write an example of Express, others have time to come up.
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
});