1.0.8 • Published 6 years ago

node-gm-captcha v1.0.8

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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

    keytyperequireddesc
    typestringyesit now only can set to 'num'
    filenamestringyeswhere to store the pic , it should be relative path
    fontSizenumbernothe font size
    wnumbernothe width of the picture
    hnumbernothe 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
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago