JSPM

node-captcha-generator

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 167
  • Score
    100M100P100Q77756F
  • License ISC

captcha image generator

Package Exports

  • node-captcha-generator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-captcha-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-captcha

node-captcha is a captcha generator write in pure js, thanks to oliver-moran.

node-captcha generate only numeric captcha, it use MNIST database to generate random number combination.

Example usage:

    let Captcha = require('node-captcha-generator');

    var c = new Captcha({
        length:5, // number length
        size:{    // output size
            width: 450,
            height: 200
        }
    });

    c.save('dirPath/to/save', function(err){

    });

    // get base64 image as string
    c.toBase64(function(err, base64){

    });

    // string value of captcha
    c.value;

    // jimp object  more info https://github.com/oliver-moran/jimp
    c.captcha;

    c.captcha.write('filePath/to/save', function(err){
    });

results

39314 39314

47612 47612

3406072 3406072

4803633 4803633

todo

  • add colors options
  • add more randomize options
  • switch to alphanumeric captcha