node-gm-captcha

1.0.8 • Public • Published

Pre

  1. this project is still on working , its functionalities are not finally completed.
  2. it now just support number captcha and has many limitations.

installation

  1. install Graphics Magick and make sure it can work on your computer.
  2. npm i node-gm-captcha

usage

let Captcha = require('node-gm-captcha');
Captcha.genPic({type:'num',filename:'./uniqueid.jpg'},(err,data)=>{
    if(err) throw err;
    console.log(data);
})

As the example above , you will get an image named 'uniqueid.jpg' under your project folder. And the data will include some data you need , such as the number , filepath , with these , you can do your business logic.

doc

genPic(param:object , callback:fn):void

  1. param

    key type required desc
    type string yes it now only can set to 'num'
    filename string yes where to store the pic , it should be relative path
    fontSize number no the font size
    w number no the width of the picture
    h number no the height of the picture
  2. callback: function(err , data:metaData){ }

Todo

  • make the pic more complex from recognizing
  • support char type capthcha
  • support mix type(char and number) captcha
  • add delete method so you can easily delete the pic
  • expose more customized params and method

Readme

Keywords

Package Sidebar

Install

npm i node-gm-captcha

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

18.4 kB

Total Files

16

Last publish

Collaborators

  • xhmm